rimecms 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/i18n/en/fields.d.ts +1 -1
- package/dist/core/i18n/en/fields.js +1 -1
- package/dist/core/i18n/fr/fields.d.ts +1 -1
- package/dist/core/i18n/fr/fields.js +1 -1
- package/dist/fields/blocks/component/AddBlockButton.svelte +1 -1
- package/dist/fields/blocks/component/Block.svelte +4 -5
- package/dist/fields/blocks/component/Blocks.svelte +17 -13
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte +52 -64
- package/dist/fields/blocks/component/focus/DefaultRender.svelte +108 -0
- package/dist/fields/blocks/component/focus/{RenderPlaceholder.svelte.d.ts → DefaultRender.svelte.d.ts} +3 -3
- package/dist/fields/blocks/component/focus/Inspector.svelte +160 -0
- package/dist/fields/blocks/component/focus/Inspector.svelte.d.ts +7 -0
- package/dist/fields/blocks/component/focus/Layers.svelte +16 -3
- package/dist/fields/blocks/component/focus/LayersList.svelte +28 -11
- package/dist/fields/blocks/component/focus/LayersList.svelte.d.ts +2 -0
- package/dist/fields/blocks/component/focus/Palette.svelte +3 -3
- package/dist/fields/blocks/component/focus/Renders.svelte +66 -15
- package/dist/fields/blocks/component/focus/Renders.svelte.d.ts +5 -1
- package/dist/fields/blocks/component/focus/StagePlaceholder.svelte +1 -4
- package/dist/fields/blocks/component/focus/focus.svelte.d.ts +26 -12
- package/dist/fields/blocks/component/focus/focus.svelte.js +114 -57
- package/dist/fields/blocks/component/picker/BlockTile.svelte +3 -5
- package/dist/fields/blocks/index.js +3 -1
- package/dist/fields/combobox/component/ComboBox.svelte +1 -1
- package/dist/fields/combobox/component/combobox.css +1 -1
- package/dist/fields/date/component/Date.svelte +1 -1
- package/dist/fields/group/component/Group.svelte +4 -4
- package/dist/fields/link/component/Link.svelte +1 -1
- package/dist/fields/link/component/RessourceInput.svelte +2 -2
- package/dist/fields/number/component/Number.svelte +1 -1
- package/dist/fields/relation/component/Cell.svelte +3 -1
- package/dist/fields/relation/component/RelationInline.svelte +50 -19
- package/dist/fields/relation/component/default/Default.svelte +3 -3
- package/dist/fields/relation/component/upload/Browse.svelte +2 -2
- package/dist/fields/relation/component/upload/Upload.svelte +2 -2
- package/dist/fields/relation/util.d.ts +9 -21
- package/dist/fields/relation/util.js +11 -28
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.css +1 -1
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.css +1 -1
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +2 -2
- package/dist/fields/rich-text/core/features/resource/resource.svelte +1 -1
- package/dist/fields/rich-text/core/features/upload/upload.svelte +1 -1
- package/dist/fields/select/component/Select.svelte +2 -2
- package/dist/fields/text/component/TextInline.svelte +113 -0
- package/dist/fields/text/component/TextInline.svelte.d.ts +14 -0
- package/dist/fields/textarea/component/TextArea.svelte +1 -1
- package/dist/fields/tree/component/TreeBlock.svelte +4 -4
- package/dist/live/context.svelte.js +7 -3
- package/dist/panel/components/fields/Error.svelte +1 -1
- package/dist/panel/components/fields/FieldsPreview.svelte +1 -1
- package/dist/panel/components/fields/FieldsPreviewTrigger.svelte +1 -1
- package/dist/panel/components/fields/Hint.svelte +1 -1
- package/dist/panel/components/fields/setting.css +6 -6
- package/dist/panel/components/sections/auth/AuthForm.svelte +2 -2
- package/dist/panel/components/sections/collection/Avatar.svelte +1 -1
- package/dist/panel/components/sections/collection/bulk-upload/FileDrop.svelte +1 -1
- package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte +3 -3
- package/dist/panel/components/sections/collection/bulk-upload/UploadProgress.svelte +1 -1
- package/dist/panel/components/sections/collection/folder/Folder.svelte +1 -1
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +2 -2
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +1 -1
- package/dist/panel/components/sections/collection/header/DisplayMode.svelte +1 -2
- package/dist/panel/components/sections/collection/list/CollectionList.svelte +2 -2
- package/dist/panel/components/sections/collection/list/header/Header.svelte +1 -1
- package/dist/panel/components/sections/collection/list/row/Row.svelte +1 -1
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +1 -1
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +1 -1
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +1 -1
- package/dist/panel/components/sections/commands/CommandButton.svelte +1 -1
- package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +1 -1
- package/dist/panel/components/sections/document/AuthFooter.svelte +2 -2
- package/dist/panel/components/sections/document/AutoSaveBanner.svelte +2 -2
- package/dist/panel/components/sections/document/ButtonStatus.svelte +1 -1
- package/dist/panel/components/sections/document/ChangeSlugDialog.svelte +1 -1
- package/dist/panel/components/sections/document/DocumentChildren.svelte +2 -2
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +2 -2
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +1 -1
- package/dist/panel/components/sections/live/LiveFloatingUI.svelte +2 -2
- package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +1 -1
- package/dist/panel/components/ui/button/button.svelte +3 -4
- package/dist/panel/components/ui/card/card.svelte +2 -2
- package/dist/panel/components/ui/card-document/card-document.svelte +2 -2
- package/dist/panel/components/ui/card-resource/card-resource.svelte +2 -2
- package/dist/panel/components/ui/command/command-dialog.svelte +2 -8
- package/dist/panel/components/ui/command/command-dialog.svelte.d.ts +1 -1
- package/dist/panel/components/ui/command/command-input.svelte +1 -1
- package/dist/panel/components/ui/context-menu/context-menu.css +1 -1
- package/dist/panel/components/ui/dialog/dialog-content.css +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +1 -1
- package/dist/panel/components/ui/input/input.svelte +1 -1
- package/dist/panel/components/ui/nav/Nav.svelte +2 -3
- package/dist/panel/components/ui/nav/NavGroup.svelte +1 -1
- package/dist/panel/components/ui/nav/NavItemButton.svelte +1 -1
- package/dist/panel/components/ui/nav/UserButton.svelte +1 -1
- package/dist/panel/components/ui/page-header/PageHeader.svelte +1 -1
- package/dist/panel/components/ui/popover/popover-content.css +1 -1
- package/dist/panel/components/ui/radio-row-group/radio-row-group.css +0 -1
- package/dist/panel/components/ui/sheet/sheet.css +1 -1
- package/dist/panel/components/ui/sonner/sonner.css +1 -1
- package/dist/panel/components/ui/switch/switch.css +0 -2
- package/dist/panel/components/ui/tabs/tabs.css +2 -1
- package/dist/panel/components/ui/tag/tag.svelte +1 -1
- package/dist/panel/components/ui/tree/tree-rows.css +3 -3
- package/dist/panel/index.d.ts +2 -1
- package/dist/panel/index.js +2 -1
- package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +1 -1
- package/dist/panel/pages/dashboard/Dashboard.svelte +1 -1
- package/dist/panel/pages/dashboard/DashboardCard.svelte +2 -2
- package/dist/panel/pages/dashboard/DashboardCollection.svelte +1 -1
- package/dist/panel/pages/dashboard/DashboardRow.svelte +1 -1
- package/dist/panel/style/index.css +13 -37
- package/dist/panel/style/mixins/index.css +1 -1
- package/dist/panel/style/palette.css +3 -3
- package/dist/panel/style/scheme.css +10 -34
- package/package.json +2 -2
- package/dist/fields/blocks/component/focus/RenderPlaceholder.svelte +0 -77
- package/dist/fields/blocks/component/focus/Stage.svelte +0 -190
- package/dist/fields/blocks/component/focus/Stage.svelte.d.ts +0 -8
- package/dist/panel/components/ui/tooltip/index.d.ts +0 -7
|
@@ -3,30 +3,18 @@ import type { Relation } from './index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a relation field's value is populated with full documents.
|
|
5
5
|
*
|
|
6
|
-
* A relation is
|
|
7
|
-
*
|
|
8
|
-
* If the value is a string or an array of relation identifier objects,
|
|
9
|
-
* it is considered not populated.
|
|
6
|
+
* A relation is populated when it is a non-empty array of documents: objects that are not
|
|
7
|
+
* relation references (`id`, `relationTo`, `documentId`). Anything else is not populated.
|
|
10
8
|
*
|
|
11
9
|
* @example
|
|
12
|
-
*
|
|
13
|
-
* isRelationPopulated('7674e91b-598a-4a72-a5cd-9594736a34dd');
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* //
|
|
17
|
-
* isRelationPopulated(
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* // Returns: false
|
|
21
|
-
* isRelationPopulated([
|
|
22
|
-
* {
|
|
23
|
-
* id: '7674e91b-598a-4a72-a5cd-9594736a34dd',
|
|
24
|
-
* relationTo: 'articles',
|
|
25
|
-
* documentId: 'b674e91b-598a-4a72-a5cd-9594736a34dd'
|
|
26
|
-
* }
|
|
27
|
-
* ]);
|
|
10
|
+
* isRelationPopulated([{ id: '7674…', title: 'Home' }]); // true
|
|
11
|
+
* isRelationPopulated('7674e91b-598a-4a72-a5cd-9594736a34dd'); // false
|
|
12
|
+
* isRelationPopulated([{ id: '7674…', relationTo: 'articles', documentId: 'b674…' }]); // false
|
|
13
|
+
* isRelationPopulated([]); // false
|
|
14
|
+
* isRelationPopulated(undefined); // false
|
|
15
|
+
* isRelationPopulated(null); // false
|
|
28
16
|
*/
|
|
29
|
-
export declare const isRelationPopulated: <T>(value: RelationValue<T>) => value is T[];
|
|
17
|
+
export declare const isRelationPopulated: <T>(value: RelationValue<T> | null | undefined) => value is T[];
|
|
30
18
|
/**
|
|
31
19
|
* Checks if a relation value is resolved (contains the actual referenced document).
|
|
32
20
|
*
|
|
@@ -2,38 +2,21 @@ import { hasProps, isObjectLiteral } from '../../util/object.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Checks if a relation field's value is populated with full documents.
|
|
4
4
|
*
|
|
5
|
-
* A relation is
|
|
6
|
-
*
|
|
7
|
-
* If the value is a string or an array of relation identifier objects,
|
|
8
|
-
* it is considered not populated.
|
|
5
|
+
* A relation is populated when it is a non-empty array of documents: objects that are not
|
|
6
|
+
* relation references (`id`, `relationTo`, `documentId`). Anything else is not populated.
|
|
9
7
|
*
|
|
10
8
|
* @example
|
|
11
|
-
*
|
|
12
|
-
* isRelationPopulated('7674e91b-598a-4a72-a5cd-9594736a34dd');
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* //
|
|
16
|
-
* isRelationPopulated(
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Returns: false
|
|
20
|
-
* isRelationPopulated([
|
|
21
|
-
* {
|
|
22
|
-
* id: '7674e91b-598a-4a72-a5cd-9594736a34dd',
|
|
23
|
-
* relationTo: 'articles',
|
|
24
|
-
* documentId: 'b674e91b-598a-4a72-a5cd-9594736a34dd'
|
|
25
|
-
* }
|
|
26
|
-
* ]);
|
|
9
|
+
* isRelationPopulated([{ id: '7674…', title: 'Home' }]); // true
|
|
10
|
+
* isRelationPopulated('7674e91b-598a-4a72-a5cd-9594736a34dd'); // false
|
|
11
|
+
* isRelationPopulated([{ id: '7674…', relationTo: 'articles', documentId: 'b674…' }]); // false
|
|
12
|
+
* isRelationPopulated([]); // false
|
|
13
|
+
* isRelationPopulated(undefined); // false
|
|
14
|
+
* isRelationPopulated(null); // false
|
|
27
15
|
*/
|
|
28
16
|
export const isRelationPopulated = (value) => {
|
|
29
|
-
if (Array.isArray(value))
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return value.every((v) => {
|
|
33
|
-
return isObjectLiteral(v) && !hasProps(['id', 'relationTo', 'documentId'], v);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return typeof value !== 'string';
|
|
17
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
18
|
+
return false;
|
|
19
|
+
return value.every((v) => isObjectLiteral(v) && !hasProps(['id', 'relationTo', 'documentId'], v));
|
|
37
20
|
};
|
|
38
21
|
/**
|
|
39
22
|
* Checks if a relation value is resolved (contains the actual referenced document).
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
</Command.List>
|
|
252
252
|
</Command.Dialog>
|
|
253
253
|
|
|
254
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
254
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
255
255
|
|
|
256
256
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
257
257
|
|
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
background-color: var(--rz-bg-float);
|
|
295
295
|
box-shadow:
|
|
296
296
|
0 0 0 1px var(--rz-border),
|
|
297
|
-
var(--rz-shadow-float);
|
|
297
|
+
var(--rz-shadow-float, 0 0 transparent);
|
|
298
298
|
animation: fadeInSlideFromTop 0.2s ease-out;
|
|
299
299
|
border-radius: var(--rz-radius-lg);
|
|
300
300
|
}
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
</Command.List>
|
|
128
128
|
</Command.Dialog>
|
|
129
129
|
|
|
130
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
130
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
131
131
|
|
|
132
132
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
133
133
|
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
</Dialog.Content>
|
|
208
208
|
</Dialog.Root>
|
|
209
209
|
|
|
210
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
210
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
211
211
|
|
|
212
212
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
213
213
|
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
<Field.Hint {config} />
|
|
156
156
|
</fieldset>
|
|
157
157
|
|
|
158
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
158
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
159
159
|
|
|
160
160
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
161
161
|
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
background-color: var(--rz-bg-float);
|
|
189
189
|
box-shadow:
|
|
190
190
|
0 0 0 1px var(--rz-border),
|
|
191
|
-
var(--rz-shadow-float);
|
|
191
|
+
var(--rz-shadow-float, 0 0 transparent);
|
|
192
192
|
position: absolute;
|
|
193
193
|
left: 0;
|
|
194
194
|
right: 0;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { TextAreaFieldBuilder } from '../../textarea/index.js';
|
|
3
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
4
|
+
import { capitalize } from '../../../util/string.js';
|
|
5
|
+
import type { TextFieldBuilder } from '../index.js';
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
path: string;
|
|
9
|
+
config: TextFieldBuilder | TextAreaFieldBuilder;
|
|
10
|
+
form: DocumentFormContext;
|
|
11
|
+
/** The element drawn: `h2`, `p`… `span` by default. */
|
|
12
|
+
as?: string;
|
|
13
|
+
class?: string;
|
|
14
|
+
};
|
|
15
|
+
const { path, config, form, as = 'span', class: className }: Props = $props();
|
|
16
|
+
|
|
17
|
+
const field = $derived(form.useField<string>(path, config));
|
|
18
|
+
/** A textarea keeps its lines; a text is one. */
|
|
19
|
+
const multiline = $derived(config.type === 'textarea');
|
|
20
|
+
let element = $state<HTMLElement>();
|
|
21
|
+
|
|
22
|
+
// The value goes into the element only when it differs from what the element shows: the caret
|
|
23
|
+
// stays where it is while typing, and a change made in the inspector shows here. The element
|
|
24
|
+
// has no children of Svelte's to lose.
|
|
25
|
+
$effect(() => {
|
|
26
|
+
const value = field.value ?? '';
|
|
27
|
+
// eslint-disable-next-line svelte/no-dom-manipulating
|
|
28
|
+
if (element && element.textContent !== value) element.textContent = value;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function oninput() {
|
|
32
|
+
if (!element) return;
|
|
33
|
+
// Emptied, the element keeps no stray line break, so its placeholder shows again.
|
|
34
|
+
// eslint-disable-next-line svelte/no-dom-manipulating
|
|
35
|
+
if (!element.textContent) element.replaceChildren();
|
|
36
|
+
field.value = element.textContent ?? '';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** In a text, Enter adds nothing. */
|
|
40
|
+
function onkeydown(event: KeyboardEvent) {
|
|
41
|
+
if (!multiline && event.key === 'Enter') event.preventDefault();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Pasted into a text, line breaks become spaces. */
|
|
45
|
+
function onpaste(event: ClipboardEvent) {
|
|
46
|
+
if (multiline) return;
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
const text = (event.clipboardData?.getData('text/plain') ?? '').replace(/\s*\r?\n\s*/g, ' ');
|
|
49
|
+
const selection = window.getSelection();
|
|
50
|
+
if (!selection?.rangeCount) return;
|
|
51
|
+
const range = selection.getRangeAt(0);
|
|
52
|
+
range.deleteContents();
|
|
53
|
+
range.insertNode(document.createTextNode(text));
|
|
54
|
+
range.collapse(false);
|
|
55
|
+
selection.removeAllRanges();
|
|
56
|
+
selection.addRange(range);
|
|
57
|
+
oninput();
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<!-- A text edited where a block render draws it: the render's own element, its tag and its class. -->
|
|
62
|
+
<svelte:element
|
|
63
|
+
this={as}
|
|
64
|
+
bind:this={element}
|
|
65
|
+
class="rz-text-inline {className ?? ''}"
|
|
66
|
+
contenteditable={field.editable ? 'plaintext-only' : 'false'}
|
|
67
|
+
role="textbox"
|
|
68
|
+
tabindex="0"
|
|
69
|
+
aria-multiline={multiline}
|
|
70
|
+
aria-label={config.get.label || capitalize(config.name)}
|
|
71
|
+
data-multiline={multiline ? '' : null}
|
|
72
|
+
data-placeholder={config.get.placeholder || capitalize(config.name)}
|
|
73
|
+
data-error={field.error ? '' : null}
|
|
74
|
+
{oninput}
|
|
75
|
+
{onkeydown}
|
|
76
|
+
{onpaste}
|
|
77
|
+
></svelte:element>
|
|
78
|
+
|
|
79
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
80
|
+
|
|
81
|
+
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
82
|
+
|
|
83
|
+
/* The hover tint, laid over the element's own fill. */
|
|
84
|
+
|
|
85
|
+
/* The picked item of a segmented control. */
|
|
86
|
+
|
|
87
|
+
/* The primary button's face: black on light, white on dark. */
|
|
88
|
+
|
|
89
|
+
/* Keyboard focus on a button, a tab, a link. */
|
|
90
|
+
|
|
91
|
+
/* A focused input: an accent edge and a soft halo. */
|
|
92
|
+
|
|
93
|
+
/* An input with an error. */
|
|
94
|
+
/* The render's own text: no frame of its own while edited, as a rich text in place. */
|
|
95
|
+
.rz-text-inline {
|
|
96
|
+
border-radius: var(--rz-radius-sm);
|
|
97
|
+
outline: none;
|
|
98
|
+
cursor: text;
|
|
99
|
+
|
|
100
|
+
&[data-multiline] {
|
|
101
|
+
white-space: pre-wrap;
|
|
102
|
+
}
|
|
103
|
+
&[data-error] {
|
|
104
|
+
outline: 1px solid var(--rz-danger);
|
|
105
|
+
outline-offset: 2px;
|
|
106
|
+
}
|
|
107
|
+
&:empty::before {
|
|
108
|
+
content: attr(data-placeholder);
|
|
109
|
+
color: var(--rz-fg-subtle);
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TextAreaFieldBuilder } from '../../textarea/index.js';
|
|
2
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
3
|
+
import type { TextFieldBuilder } from '../index.js';
|
|
4
|
+
type Props = {
|
|
5
|
+
path: string;
|
|
6
|
+
config: TextFieldBuilder | TextAreaFieldBuilder;
|
|
7
|
+
form: DocumentFormContext;
|
|
8
|
+
/** The element drawn: `h2`, `p`… `span` by default. */
|
|
9
|
+
as?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const TextInline: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type TextInline = ReturnType<typeof TextInline>;
|
|
14
|
+
export default TextInline;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<Field.Hint {config} />
|
|
29
29
|
</fieldset>
|
|
30
30
|
|
|
31
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
31
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
32
32
|
|
|
33
33
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
34
34
|
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
</div>
|
|
165
165
|
</div>
|
|
166
166
|
|
|
167
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
167
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
168
168
|
|
|
169
169
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
170
170
|
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
background-color: var(--rz-bg-raised);
|
|
185
185
|
box-shadow:
|
|
186
186
|
0 0 0 1px var(--rz-border),
|
|
187
|
-
var(--rz-shadow-raised);
|
|
187
|
+
var(--rz-shadow-raised, 0 0 transparent);
|
|
188
188
|
border-radius: var(--rz-radius-xl);
|
|
189
189
|
}
|
|
190
190
|
|
|
@@ -197,8 +197,8 @@
|
|
|
197
197
|
background-color: transparent;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
/* Inside a group, a block or
|
|
201
|
-
:global(:is(.rz-group-field__content, .rz-block__fields, .rz-
|
|
200
|
+
/* Inside a group, a block or the inspector: a hairline, no second fill. */
|
|
201
|
+
:global(:is(.rz-group-field__content, .rz-block__fields, .rz-inspector__fields)) .rz-tree-item {
|
|
202
202
|
background-color: transparent;
|
|
203
203
|
box-shadow: 0 0 0 1px var(--rz-border);
|
|
204
204
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { page } from '$app/state';
|
|
2
|
-
import { env } from '$env/dynamic/public';
|
|
3
2
|
import { PARAMS } from '../core/constants.js';
|
|
4
3
|
import { getContext, setContext } from 'svelte';
|
|
5
4
|
import { getValueAtPath, setValueAtPath } from '../util/object.js';
|
|
6
5
|
import { populate } from '../fields/relation/populate.js';
|
|
7
6
|
export const LIVE_KEY = Symbol('rime.live');
|
|
7
|
+
/**
|
|
8
|
+
* The panel's origin, the only one whose messages are read. `$env/dynamic/public` loads with the
|
|
9
|
+
* first message, so `rimecms/public` imports outside a SvelteKit page, in a component spec.
|
|
10
|
+
*/
|
|
11
|
+
let panelOrigin;
|
|
12
|
+
const getPanelOrigin = () => (panelOrigin ??= import('$env/dynamic/public').then(({ env }) => new URL(env.PUBLIC_RIME_URL).origin));
|
|
8
13
|
function createStore(href) {
|
|
9
14
|
let enabled = $state(false);
|
|
10
15
|
let doc = $state();
|
|
11
16
|
const liveStore = $state({});
|
|
12
17
|
let activePanelKey = $state(null);
|
|
13
|
-
const origin = new URL(env.PUBLIC_RIME_URL).origin;
|
|
14
18
|
/**
|
|
15
19
|
* Handles navigation within iframe to maintain live editing mode
|
|
16
20
|
*/
|
|
@@ -28,7 +32,7 @@ function createStore(href) {
|
|
|
28
32
|
*/
|
|
29
33
|
const onMessage = async (e) => {
|
|
30
34
|
// Only accept messages from the trusted panel origin
|
|
31
|
-
if (e.origin !==
|
|
35
|
+
if (e.origin !== (await getPanelOrigin()))
|
|
32
36
|
return;
|
|
33
37
|
// Handle handshake request
|
|
34
38
|
if (e.data.handshake) {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
{/if}
|
|
29
29
|
|
|
30
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
30
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
31
31
|
|
|
32
32
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
33
33
|
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
{/if}
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
48
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
49
49
|
|
|
50
50
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
51
51
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
{@render children()}
|
|
11
11
|
</button>
|
|
12
12
|
|
|
13
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
13
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
14
14
|
|
|
15
15
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</p>
|
|
24
24
|
{/if}
|
|
25
25
|
|
|
26
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
26
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
27
27
|
|
|
28
28
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
29
29
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Rows that follow each other share one card, a hairline between them.
|
|
4
4
|
*
|
|
5
5
|
* ╭────────────────────────────────────╮
|
|
6
|
-
* │ Show in the navigation ━●
|
|
6
|
+
* │ Show in the navigation ━● │
|
|
7
7
|
* ├────────────────────────────────────┤
|
|
8
|
-
* │ Hide from search engines ●━
|
|
8
|
+
* │ Hide from search engines ●━ │
|
|
9
9
|
* ╰────────────────────────────────────╯
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
background-color: var(--rz-bg-raised);
|
|
14
14
|
box-shadow:
|
|
15
15
|
0 0 0 1px var(--rz-border),
|
|
16
|
-
var(--rz-shadow-raised);
|
|
16
|
+
var(--rz-shadow-raised, 0 0 transparent);
|
|
17
17
|
border-radius: var(--rz-radius-xl);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
margin-top: var(--rz-size-0-5);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/* Inside a group, a block, a tree item or
|
|
37
|
-
:is(.rz-group-field__content, .rz-block__fields, .rz-tree-item__fields, .rz-
|
|
36
|
+
/* Inside a group, a block, a tree item or the inspector: a hairline, no second fill. */
|
|
37
|
+
:is(.rz-group-field__content, .rz-block__fields, .rz-tree-item__fields, .rz-inspector__fields)
|
|
38
38
|
.rz-setting {
|
|
39
39
|
background-color: transparent;
|
|
40
40
|
box-shadow: 0 0 0 1px var(--rz-border);
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/* Without a fill, the earlier row's edge is the hairline: the later one hides its own. */
|
|
75
|
-
:is(.rz-group-field__content, .rz-block__fields, .rz-tree-item__fields, .rz-
|
|
75
|
+
:is(.rz-group-field__content, .rz-block__fields, .rz-tree-item__fields, .rz-inspector__fields)
|
|
76
76
|
.rz-render-fields__field--full:is([data-type='toggle'], [data-type='checkbox']):has(
|
|
77
77
|
> .rz-setting[data-visible]
|
|
78
78
|
)
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
28
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
29
29
|
|
|
30
30
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
31
31
|
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
background-color: var(--rz-bg-raised);
|
|
69
69
|
box-shadow:
|
|
70
70
|
0 0 0 1px var(--rz-border),
|
|
71
|
-
var(--rz-shadow-raised);
|
|
71
|
+
var(--rz-shadow-raised, 0 0 transparent);
|
|
72
72
|
|
|
73
73
|
@media (min-width: 1024px) {
|
|
74
74
|
margin: 1rem;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
<span class="rz-avatar rz-avatar--{size}" aria-hidden="true">{initials}</span>
|
|
22
22
|
|
|
23
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
23
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
24
24
|
|
|
25
25
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
26
26
|
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
/>
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
86
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
87
87
|
|
|
88
88
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
89
89
|
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
</div>
|
|
112
112
|
{/if}
|
|
113
113
|
|
|
114
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
114
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
115
115
|
|
|
116
116
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
117
117
|
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
background-color: var(--rz-bg-float);
|
|
143
143
|
box-shadow:
|
|
144
144
|
0 0 0 1px var(--rz-border),
|
|
145
|
-
var(--rz-shadow-float);
|
|
145
|
+
var(--rz-shadow-float, 0 0 transparent);
|
|
146
146
|
font-variation-settings: 'wght' 500;
|
|
147
147
|
font-weight: 500;
|
|
148
148
|
display: flex;
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
background-color: var(--rz-bg-float);
|
|
159
159
|
box-shadow:
|
|
160
160
|
0 0 0 1px var(--rz-border),
|
|
161
|
-
var(--rz-shadow-float);
|
|
161
|
+
var(--rz-shadow-float, 0 0 transparent);
|
|
162
162
|
position: fixed;
|
|
163
163
|
right: var(--rz-size-4);
|
|
164
164
|
bottom: var(--rz-size-4);
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
{/if}
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
28
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
29
29
|
|
|
30
30
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
31
31
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
{@render children()}
|
|
30
30
|
</h3>
|
|
31
31
|
|
|
32
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
32
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
33
33
|
|
|
34
34
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
35
35
|
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
|
|
211
211
|
<FolderEdit bind:open={editFolderDialogOpen} {folder} {collection} />
|
|
212
212
|
|
|
213
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
213
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
214
214
|
|
|
215
215
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
216
216
|
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
background-color: var(--rz-bg-raised);
|
|
231
231
|
box-shadow:
|
|
232
232
|
0 0 0 1px var(--rz-border),
|
|
233
|
-
var(--rz-shadow-raised);
|
|
233
|
+
var(--rz-shadow-raised, 0 0 transparent);
|
|
234
234
|
display: flex;
|
|
235
235
|
width: 100%;
|
|
236
236
|
height: calc(10.5 * var(--rz-unit));
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
{/if}
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
140
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
141
141
|
|
|
142
142
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
143
143
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
{/each}
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
33
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
34
34
|
|
|
35
35
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
36
36
|
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
|
|
70
70
|
&[aria-pressed='true'] {
|
|
71
71
|
background-color: var(--rz-bg-knob);
|
|
72
|
-
box-shadow: var(--rz-shadow-knob);
|
|
73
72
|
color: var(--rz-fg);
|
|
74
73
|
}
|
|
75
74
|
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
{/if}
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
62
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
63
63
|
|
|
64
64
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
65
65
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
background-color: var(--rz-bg-raised);
|
|
86
86
|
box-shadow:
|
|
87
87
|
0 0 0 1px var(--rz-border),
|
|
88
|
-
var(--rz-shadow-raised);
|
|
88
|
+
var(--rz-shadow-raised, 0 0 transparent);
|
|
89
89
|
border-radius: var(--rz-radius-lg);
|
|
90
90
|
overflow: hidden;
|
|
91
91
|
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
62
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
63
63
|
|
|
64
64
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
65
65
|
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
112
112
|
|
|
113
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
113
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
114
114
|
|
|
115
115
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
116
116
|
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
{/if}
|
|
123
123
|
{/key}
|
|
124
124
|
|
|
125
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
125
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
126
126
|
|
|
127
127
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
128
128
|
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
</div>
|
|
100
100
|
{/key}
|
|
101
101
|
|
|
102
|
-
<style>/* A level: its fill, a hairline, its shadow. raised, float. */
|
|
102
|
+
<style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
|
|
103
103
|
|
|
104
104
|
/* A well: an input, a track, a dropzone. Its edge shows on hover. */
|
|
105
105
|
|