updated dependencies
This commit is contained in:
@@ -2,7 +2,6 @@ import {axiosInstance} from "./bootstrap";
|
||||
import "../sass/app.scss";
|
||||
import Account from "./svelte/Account.svelte";
|
||||
import Channel from "./svelte/Channel.svelte";
|
||||
import * as bootstrap from "bootstrap";
|
||||
import Mustache from "mustache";
|
||||
import 'htmx.org';
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
import ActionsOnSelected from "./ActionsOnSelected.svelte";
|
||||
import Table from "./Table.svelte";
|
||||
import {getContext} from "svelte";
|
||||
import Grid from "./Grid.svelte";
|
||||
|
||||
const axios = getContext("axios");
|
||||
export let schema;
|
||||
@@ -71,40 +70,19 @@
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if schema.type === "collection"}
|
||||
<Table
|
||||
{records}
|
||||
{graph}
|
||||
{schema}
|
||||
{sortParam}
|
||||
{sortField}
|
||||
{systemFields}
|
||||
{inModal}
|
||||
{users}
|
||||
{isWritable}
|
||||
bind:selected
|
||||
/>
|
||||
{:else}
|
||||
<Table
|
||||
{records}
|
||||
{graph}
|
||||
{schema}
|
||||
{sortParam}
|
||||
{sortField}
|
||||
{systemFields}
|
||||
{inModal}
|
||||
{users}
|
||||
{isWritable}
|
||||
bind:selected
|
||||
/>
|
||||
<!-- <Grid-->
|
||||
<!-- {records}-->
|
||||
<!-- {schema}-->
|
||||
<!-- {isWritable}-->
|
||||
<!-- bind:selected-->
|
||||
<!-- />-->
|
||||
<Table
|
||||
{records}
|
||||
{graph}
|
||||
{schema}
|
||||
{sortParam}
|
||||
{sortField}
|
||||
{systemFields}
|
||||
{inModal}
|
||||
{users}
|
||||
{isWritable}
|
||||
bind:selected
|
||||
/>
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<Pagination
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
}
|
||||
|
||||
$: visibleColumns = schema.fields.filter(c => schema.visible?.includes(c.name) ?? [])
|
||||
|
||||
</script>
|
||||
|
||||
<div class="table mt-5 ">
|
||||
@@ -81,7 +80,7 @@
|
||||
|
||||
{/if}
|
||||
{#if record._file?.path}
|
||||
<Preview record={record} size="medium"/>
|
||||
<Preview record={record} size={record._file?.width > 0 ? "medium" : "tiny"}/>
|
||||
{/if}
|
||||
<a
|
||||
class="me-2 text-decoration-none text-dark fs-6"
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</a>
|
||||
{/if}
|
||||
{:else }
|
||||
<div class="d-inline-block ms-1">
|
||||
<div>
|
||||
<Uploader {schema} on:uploadComplete={uploadComplete}/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
|
||||
import {createEventDispatcher, getContext, onMount} from "svelte";
|
||||
import {createEventDispatcher, getContext} from "svelte";
|
||||
import Icon from "../common/Icon.svelte";
|
||||
import Index from "../content/Index.svelte";
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
// });
|
||||
|
||||
|
||||
export function close() {
|
||||
export function close(e) {
|
||||
if(e){
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
dialogEl.close()
|
||||
selectedRecords = [];
|
||||
}
|
||||
@@ -45,23 +49,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
export function open(schema) {
|
||||
export function open( schema) {
|
||||
dialogEl.showModal()
|
||||
load(schema);
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<dialog bind:this={dialogEl}>
|
||||
{#if data.schema}
|
||||
{#if data.schema}
|
||||
|
||||
|
||||
<div class="dialog-header">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary me-1"
|
||||
class="button"
|
||||
on:click={insert}
|
||||
disabled={selectedRecords.length === 0}
|
||||
>
|
||||
@@ -69,7 +72,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary me-3"
|
||||
class="button"
|
||||
on:click={replace}
|
||||
disabled={selectedRecords.length === 0}
|
||||
>
|
||||
@@ -89,9 +92,9 @@
|
||||
>
|
||||
<Icon icon="close"></Icon>
|
||||
</button>
|
||||
<div class="dialog-body">
|
||||
<Index {...data} bind:selected={selectedRecords}></Index>
|
||||
</div>
|
||||
<div class="dialog-body">
|
||||
<Index {...data} bind:selected={selectedRecords}></Index>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
</dialog>
|
||||
@@ -53,7 +53,7 @@
|
||||
>
|
||||
<Icon icon="file" width={fileSide} height={fileSide}/>
|
||||
<span class="ms-2"
|
||||
>.{record._file.path.split(".").pop()}</span
|
||||
>.{record._file.path.split(".").pop().toLowerCase()}</span
|
||||
>
|
||||
</a>
|
||||
{/if}
|
||||
@@ -63,7 +63,7 @@
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
title={record._file.path}
|
||||
class="preview-file-filename lx-small-text text-decoration-none"
|
||||
>{record._file.path}</a
|
||||
>{record._file.path} </a
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -43,16 +43,15 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<fieldset disabled={isLoading}>
|
||||
<label class="btn btn-primary btn-sm btn-spinner ">
|
||||
<fieldset class="upload-button" disabled={isLoading}>
|
||||
<label class="button primary btn-spinner ">
|
||||
<span
|
||||
class="spinner-border spinner-border-sm"
|
||||
role="status"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
Upload file
|
||||
<span
|
||||
class="spinner-border spinner-border-sm"
|
||||
role="status"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</span>
|
||||
|
||||
<input
|
||||
on:input={upload}
|
||||
class="form-control"
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import "tinymce/icons/default";
|
||||
import "tinymce/themes/silver";
|
||||
import "tinymce/skins/ui/oxide/skin.css";
|
||||
import contentUiSkinCss from "tinymce/skins/ui/oxide/content.css";
|
||||
import customcss from "./tinymce.css";
|
||||
import contentUiSkinCss from "tinymce/skins/ui/oxide/content.css?inline";
|
||||
import customcss from "./tinymce.css?inline";
|
||||
|
||||
import "tinymce/plugins/link";
|
||||
import "tinymce/plugins/code";
|
||||
|
||||
@@ -36,7 +36,10 @@ export function previewTitle(schemas, record, graph) {
|
||||
|
||||
function noTemplate(schema, record) {
|
||||
if (schema?.type === "files") {
|
||||
return record._file.path;
|
||||
if(record._file.width === 0){
|
||||
return record._file.path;
|
||||
}
|
||||
return record._file.path + " " + record._file.width+"x"+record._file.height ;
|
||||
}
|
||||
|
||||
let title = stripHtml(
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<script>
|
||||
import {createEventDispatcher, getContext} from "svelte";
|
||||
import {uniqBy} from "lodash";
|
||||
import {sortByField} from "../../edges/sortEdges";
|
||||
import Sortable from "../../libs/Sortable.svelte";
|
||||
import PreviewFile from "../previews/PreviewFile.svelte";
|
||||
import Dropdown from "../../common/Dropdown.svelte";
|
||||
import Dialog from "../../dialog/Dialog.svelte";
|
||||
import {insertEdges} from "./reference.js";
|
||||
import {getContext} from "svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
export let field;
|
||||
export let record;
|
||||
export let graph
|
||||
const dispatch = createEventDispatcher();
|
||||
let browseModal;
|
||||
$: references = graph?.edges
|
||||
.filter((edge) => edge.field === field.name)
|
||||
@@ -33,7 +32,6 @@
|
||||
function openBrowseModal(e, schema) {
|
||||
e.preventDefault();
|
||||
browseModal.open(schema);
|
||||
|
||||
}
|
||||
|
||||
async function reorder(e) {
|
||||
@@ -45,26 +43,7 @@
|
||||
function insert(e) {
|
||||
e.preventDefault();
|
||||
browseModal.close();
|
||||
const recordsToInsert = e.detail.records;
|
||||
const action = e.detail.action;
|
||||
let newEdges = recordsToInsert.map((r) => {
|
||||
return {
|
||||
target: r.id,
|
||||
source: record.id,
|
||||
sourceSchema: record.schema,
|
||||
targetSchema: r.schema,
|
||||
field: field.name,
|
||||
rank: ""
|
||||
};
|
||||
});
|
||||
|
||||
let replacedEdges = graph.edges ?? [];
|
||||
if (action === "replace") {
|
||||
replacedEdges = replacedEdges.filter((e) => e.field !== field.name);
|
||||
}
|
||||
|
||||
graph.records = uniqBy([...graph.records, ...recordsToInsert], (r) => r.id);
|
||||
graph.edges = uniqBy([...replacedEdges, ...newEdges], (e) => e.target + e.field);
|
||||
graph = insertEdges(graph, record, e.detail.records, field.name, e.detail.action);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -85,8 +64,7 @@
|
||||
<!-- {`${channelurl}/content/${collection.name}?parent=${record.id}&parentfield=${field.name}`} -->
|
||||
<a
|
||||
class="dropdown-item"
|
||||
on:click={(e) =>
|
||||
openBrowseModal(e, collection.name)}
|
||||
on:click={(e) => openBrowseModal(e, collection.name)}
|
||||
href="/">{collection.label}</a
|
||||
>
|
||||
{/each}
|
||||
@@ -94,14 +72,10 @@
|
||||
{/if}
|
||||
</div>
|
||||
{#if references.length > 0}
|
||||
<Sortable sortableClass="row row-cols-3 mt-3" on:update={reorder}>
|
||||
<Sortable sortableClass="mt-3" on:update={reorder}>
|
||||
{#each references as reference (reference.id)}
|
||||
<div class="col mb-3">
|
||||
<PreviewFile record={reference} hasDelete={true} on:remove={removeReference}></PreviewFile>
|
||||
|
||||
</div>
|
||||
<PreviewFile record={reference} hasDelete={true} on:remove={removeReference}></PreviewFile>
|
||||
{/each}
|
||||
</Sortable>
|
||||
{/if}
|
||||
<Dialog bind:this={browseModal} on:insert={insert}></Dialog>
|
||||
<!--<BrowseModal bind:this={browseModal} on:insert={insert}/>-->
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import Icon from "../../common/Icon.svelte";
|
||||
import InlineEdit from "../InlineEdit.svelte";
|
||||
import BrowseModal from "./BrowseModal.svelte";
|
||||
import Dialog from "../../dialog/Dialog.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
// export let field;
|
||||
@@ -120,7 +121,7 @@
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<BrowseModal bind:this={browseModal} on:insert={insert}/>
|
||||
<Dialog bind:this={browseModal} on:insert={insert}/>
|
||||
|
||||
<style>
|
||||
:global(.inline-card-wrapper) {
|
||||
|
||||
@@ -22,26 +22,28 @@
|
||||
</script>
|
||||
|
||||
<div class="preview-file">
|
||||
<div class="image">
|
||||
<Preview {record} size="small"/>
|
||||
</div>
|
||||
<div class="title">
|
||||
<div>
|
||||
<a
|
||||
class="record-title"
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
>
|
||||
{cardTitle}
|
||||
</a>
|
||||
<small class="d-block">
|
||||
from {schema.label}
|
||||
{#if record.status === "draft"}
|
||||
<Status status={record.status}/>
|
||||
{/if}
|
||||
</small>
|
||||
<div style="display: flex;align-items: center;gap: 10px;">
|
||||
<div class="image">
|
||||
<Preview {record} size="small"/>
|
||||
</div>
|
||||
<div class="title">
|
||||
<div>
|
||||
<a
|
||||
class="record-title"
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
>
|
||||
{cardTitle}
|
||||
</a>
|
||||
<small class="d-block">
|
||||
from {schema.label}
|
||||
{#if record.status === "draft"}
|
||||
<Status status={record.status}/>
|
||||
{/if}
|
||||
</small>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{#if hasDelete}
|
||||
<div class="trash-action">
|
||||
|
||||
Generated
+1081
-743
File diff suppressed because it is too large
Load Diff
+15
-18
@@ -6,30 +6,27 @@
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codemirror/commands": "^6.1.2",
|
||||
"@codemirror/commands": "^6.6.0",
|
||||
"@codemirror/lang-json": "^6.0.1",
|
||||
"@codemirror/state": "^6.1.3",
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"@sveltejs/vite-plugin-svelte": "^1.1.1",
|
||||
"axios": "^0.25",
|
||||
"bootstrap": "^5.2.2",
|
||||
"@codemirror/state": "^6.4.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
||||
"axios": "1.6.0",
|
||||
"codemirror": "^6.0.1",
|
||||
"date-fns": "^2.29.3",
|
||||
"date-fns": "^3.6.0",
|
||||
"flatpickr": "^4.6.13",
|
||||
"laravel-vite-plugin": "^0.7.0",
|
||||
"lodash": "^4.17.19",
|
||||
"laravel-vite-plugin": "^1.0.5",
|
||||
"lodash": "^4.17.21",
|
||||
"mustache": "^4.2.0",
|
||||
"postcss": "^8.4.19",
|
||||
"sass": "^1.56.1",
|
||||
"sortablejs": "^1.15.0",
|
||||
"svelte": "^3.53.1",
|
||||
"tinymce": "^6.2.0",
|
||||
"uuid": "^8.3.2",
|
||||
"vis-network": "^9.1.2",
|
||||
"vite": "^3.2.3"
|
||||
"postcss": "8.4.31",
|
||||
"sass": "^1.77.8",
|
||||
"sortablejs": "^1.15.2",
|
||||
"svelte": "^4.2.18",
|
||||
"tinymce": "6.8.0",
|
||||
"uuid": "^10.0.0",
|
||||
"vite": "5.2.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/lang-markdown": "^6.2.2",
|
||||
"@codemirror/lang-markdown": "^6.2.5",
|
||||
"htmx.org": "^2.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,20 @@
|
||||
&.active {
|
||||
filter: brightness(74%);
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-button{
|
||||
padding: 0;
|
||||
border: none;
|
||||
|
||||
|
||||
label{
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,32 +4,44 @@
|
||||
// border: 2px solid burlywood;
|
||||
// border-radius: 5px;
|
||||
//}
|
||||
|
||||
html {
|
||||
//scrollbar-gutter: stable;
|
||||
}
|
||||
|
||||
body:has(dialog[open]) {
|
||||
overflow: hidden;
|
||||
}
|
||||
dialog{
|
||||
|
||||
dialog {
|
||||
margin: 10px auto;
|
||||
background-color: #fff;
|
||||
padding: 34px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
//position: relative;
|
||||
|
||||
.close{
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.dialog-body{
|
||||
.dialog-body {
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
dialog::backdrop {
|
||||
|
||||
backdrop-filter: blur(3px);
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
@@ -24,16 +24,17 @@
|
||||
transition: 600ms;
|
||||
flex-grow: 1;
|
||||
top: 35px;
|
||||
min-width: max-content;
|
||||
|
||||
&.orientation-right {
|
||||
& .orientation-right {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
&.orientation-left {
|
||||
& .orientation-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
min-width: max-content;
|
||||
|
||||
}
|
||||
|
||||
.dropdown-header, .dropdown-item {
|
||||
|
||||
@@ -4,16 +4,21 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
font-size: 14px;
|
||||
border-radius: 12px;
|
||||
padding: 4px 18px;
|
||||
background: var(--background);
|
||||
list-style: none;
|
||||
filter: brightness(90%);
|
||||
|
||||
|
||||
a,span{
|
||||
font-size: 14px;
|
||||
border-radius: 12px;
|
||||
padding: 4px 18px;
|
||||
background: var(--background);
|
||||
|
||||
filter: brightness(90%);
|
||||
}
|
||||
|
||||
|
||||
&.disabled {
|
||||
pointer-events: none;
|
||||
@@ -21,7 +26,11 @@
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: var(--secondary);
|
||||
span{
|
||||
background: var(--secondary);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
.preview-file{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
background: var(--background);
|
||||
border-radius: 12px;
|
||||
@@ -13,6 +14,7 @@
|
||||
|
||||
.trash-action{
|
||||
display: none;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
&:hover{
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ $themes: (
|
||||
@import "./tabs";
|
||||
@import "./switch";
|
||||
@import "./preview";
|
||||
@import "./modal";
|
||||
@import "./dialog";
|
||||
|
||||
body {
|
||||
background-color: var(--background);
|
||||
|
||||
Reference in New Issue
Block a user