rimecms 1.0.0 → 1.1.0

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.
Files changed (174) hide show
  1. package/dist/adapter-sqlite/generate-schema/templates.server.d.ts +9 -9
  2. package/dist/adapter-sqlite/generate-schema/templates.server.js +9 -9
  3. package/dist/adapter-sqlite/paths.server.js +24 -15
  4. package/dist/adapter-sqlite/rows.server.d.ts +1 -1
  5. package/dist/core/adapter.d.ts +8 -4
  6. package/dist/core/boot.server.d.ts +2 -2
  7. package/dist/core/config/context.server.d.ts +2 -2
  8. package/dist/core/dev/codegen/routes/common.server.d.ts +2 -0
  9. package/dist/core/dev/codegen/routes/common.server.js +7 -3
  10. package/dist/core/dev/codegen/routes/util.server.d.ts +2 -1
  11. package/dist/core/dev/codegen/routes/util.server.js +4 -1
  12. package/dist/core/dev/config-memo.server.js +4 -0
  13. package/dist/core/i18n/en/fields.d.ts +1 -1
  14. package/dist/core/i18n/en/fields.js +1 -1
  15. package/dist/core/i18n/fr/fields.d.ts +1 -1
  16. package/dist/core/i18n/fr/fields.js +1 -1
  17. package/dist/core/prototype/collection/operations/duplicate.js +1 -1
  18. package/dist/core/prototype/collection/thumbnail/hooks/set-document-thumbnail.server.js +1 -1
  19. package/dist/core/prototype/shared/title/hooks/set-document-title.server.js +1 -1
  20. package/dist/core/prototype/shared/url/addresses.server.d.ts +10 -0
  21. package/dist/core/prototype/shared/url/addresses.server.js +17 -17
  22. package/dist/core/prototype/shared/url/hooks/detach-paths.server.d.ts +3 -2
  23. package/dist/core/prototype/shared/url/hooks/detach-paths.server.js +9 -8
  24. package/dist/core/prototype/shared/url/hooks/sync-paths.server.d.ts +3 -2
  25. package/dist/core/prototype/shared/url/hooks/sync-paths.server.js +5 -4
  26. package/dist/fields/blocks/component/AddBlockButton.svelte +1 -1
  27. package/dist/fields/blocks/component/Block.svelte +4 -5
  28. package/dist/fields/blocks/component/Blocks.svelte +17 -13
  29. package/dist/fields/blocks/component/focus/BlocksFocus.svelte +53 -65
  30. package/dist/fields/blocks/component/focus/DefaultRender.svelte +108 -0
  31. package/dist/fields/blocks/component/focus/{RenderPlaceholder.svelte.d.ts → DefaultRender.svelte.d.ts} +3 -3
  32. package/dist/fields/blocks/component/focus/Inspector.svelte +160 -0
  33. package/dist/fields/blocks/component/focus/Inspector.svelte.d.ts +7 -0
  34. package/dist/fields/blocks/component/focus/Layers.svelte +16 -3
  35. package/dist/fields/blocks/component/focus/LayersList.svelte +28 -11
  36. package/dist/fields/blocks/component/focus/LayersList.svelte.d.ts +2 -0
  37. package/dist/fields/blocks/component/focus/Palette.svelte +3 -3
  38. package/dist/fields/blocks/component/focus/Renders.svelte +66 -15
  39. package/dist/fields/blocks/component/focus/Renders.svelte.d.ts +5 -1
  40. package/dist/fields/blocks/component/focus/StagePlaceholder.svelte +1 -4
  41. package/dist/fields/blocks/component/focus/focus.svelte.d.ts +26 -12
  42. package/dist/fields/blocks/component/focus/focus.svelte.js +114 -57
  43. package/dist/fields/blocks/component/picker/BlockTile.svelte +3 -5
  44. package/dist/fields/combobox/component/ComboBox.svelte +1 -1
  45. package/dist/fields/combobox/component/combobox.css +1 -1
  46. package/dist/fields/date/component/Date.svelte +1 -1
  47. package/dist/fields/group/component/Group.svelte +4 -4
  48. package/dist/fields/link/component/Link.svelte +1 -1
  49. package/dist/fields/link/component/RessourceInput.svelte +2 -2
  50. package/dist/fields/link/index.d.ts +1 -1
  51. package/dist/fields/number/component/Number.svelte +1 -1
  52. package/dist/fields/relation/component/Cell.svelte +3 -1
  53. package/dist/fields/relation/component/RelationInline.svelte +51 -20
  54. package/dist/fields/relation/component/default/Default.svelte +3 -3
  55. package/dist/fields/relation/component/upload/Browse.svelte +2 -2
  56. package/dist/fields/relation/component/upload/Upload.svelte +2 -2
  57. package/dist/fields/relation/index.d.ts +1 -41
  58. package/dist/fields/relation/index.js +0 -67
  59. package/dist/fields/relation/util.d.ts +69 -0
  60. package/dist/fields/relation/util.js +103 -0
  61. package/dist/fields/rich-text/client.d.ts +2 -5
  62. package/dist/fields/rich-text/client.js +1 -3
  63. package/dist/fields/rich-text/component/Cell.svelte +1 -1
  64. package/dist/fields/rich-text/component/bubble-menu/bubble-menu.css +1 -1
  65. package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.css +1 -1
  66. package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +2 -2
  67. package/dist/fields/rich-text/core/features/resource/resource-extension.js +3 -3
  68. package/dist/fields/rich-text/core/features/resource/resource.svelte +2 -2
  69. package/dist/fields/rich-text/core/features/upload/upload-extension.js +3 -4
  70. package/dist/fields/rich-text/core/features/upload/upload.svelte +2 -2
  71. package/dist/fields/rich-text/index.d.ts +0 -17
  72. package/dist/fields/rich-text/index.js +0 -44
  73. package/dist/fields/rich-text/json.d.ts +18 -0
  74. package/dist/fields/rich-text/json.js +44 -0
  75. package/dist/fields/select/component/Select.svelte +2 -2
  76. package/dist/fields/text/component/TextInline.svelte +113 -0
  77. package/dist/fields/text/component/TextInline.svelte.d.ts +14 -0
  78. package/dist/fields/textarea/component/TextArea.svelte +1 -1
  79. package/dist/fields/tree/component/TreeBlock.svelte +4 -4
  80. package/dist/index.d.ts +2 -9
  81. package/dist/index.js +3 -8
  82. package/dist/{panel/components/sections/live → live}/Consumer.svelte +2 -2
  83. package/dist/{panel/components/sections/live → live}/Consumer.svelte.d.ts +1 -1
  84. package/dist/{panel/components/sections/live → live}/LiveEdit.svelte +2 -2
  85. package/dist/{panel/components/sections/live → live}/Provider.svelte +1 -1
  86. package/dist/{panel/context/live.svelte.d.ts → live/context.svelte.d.ts} +1 -1
  87. package/dist/{panel/context/live.svelte.js → live/context.svelte.js} +3 -3
  88. package/dist/panel/components/fields/Error.svelte +1 -1
  89. package/dist/panel/components/fields/FieldsPreview.svelte +1 -1
  90. package/dist/panel/components/fields/FieldsPreviewTrigger.svelte +1 -1
  91. package/dist/panel/components/fields/Hint.svelte +1 -1
  92. package/dist/panel/components/fields/setting.css +6 -6
  93. package/dist/panel/components/sections/auth/AuthForm.svelte +2 -2
  94. package/dist/panel/components/sections/collection/Avatar.svelte +1 -1
  95. package/dist/panel/components/sections/collection/bulk-upload/FileDrop.svelte +1 -1
  96. package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte +3 -3
  97. package/dist/panel/components/sections/collection/bulk-upload/UploadProgress.svelte +1 -1
  98. package/dist/panel/components/sections/collection/folder/Folder.svelte +1 -1
  99. package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +2 -2
  100. package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +1 -1
  101. package/dist/panel/components/sections/collection/header/DisplayMode.svelte +1 -2
  102. package/dist/panel/components/sections/collection/list/CollectionList.svelte +2 -2
  103. package/dist/panel/components/sections/collection/list/header/Header.svelte +1 -1
  104. package/dist/panel/components/sections/collection/list/row/Row.svelte +1 -1
  105. package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +1 -1
  106. package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +1 -1
  107. package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +1 -1
  108. package/dist/panel/components/sections/commands/CommandButton.svelte +1 -1
  109. package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +1 -1
  110. package/dist/panel/components/sections/document/AuthFooter.svelte +2 -2
  111. package/dist/panel/components/sections/document/AutoSaveBanner.svelte +2 -2
  112. package/dist/panel/components/sections/document/ButtonStatus.svelte +1 -1
  113. package/dist/panel/components/sections/document/ChangeSlugDialog.svelte +1 -1
  114. package/dist/panel/components/sections/document/DocumentChildren.svelte +2 -2
  115. package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +2 -2
  116. package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +1 -1
  117. package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte.d.ts +1 -1
  118. package/dist/panel/components/sections/live/LiveFloatingUI.svelte +2 -2
  119. package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +1 -1
  120. package/dist/panel/components/ui/button/button.svelte +3 -4
  121. package/dist/panel/components/ui/calendar/calendar.svelte.d.ts +1 -1
  122. package/dist/panel/components/ui/card/card.svelte +2 -2
  123. package/dist/panel/components/ui/card-document/card-document.svelte +2 -2
  124. package/dist/panel/components/ui/card-resource/card-resource.svelte +2 -2
  125. package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
  126. package/dist/panel/components/ui/command/command-input.svelte +1 -1
  127. package/dist/panel/components/ui/context-menu/context-menu.css +1 -1
  128. package/dist/panel/components/ui/dialog/dialog-content.css +1 -1
  129. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -1
  130. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +1 -1
  131. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +1 -1
  132. package/dist/panel/components/ui/input/input.svelte +1 -1
  133. package/dist/panel/components/ui/nav/Nav.svelte +2 -3
  134. package/dist/panel/components/ui/nav/NavGroup.svelte +1 -1
  135. package/dist/panel/components/ui/nav/NavItemButton.svelte +1 -1
  136. package/dist/panel/components/ui/nav/UserButton.svelte +1 -1
  137. package/dist/panel/components/ui/page-header/PageHeader.svelte +1 -1
  138. package/dist/panel/components/ui/popover/popover-content.css +1 -1
  139. package/dist/panel/components/ui/radio-row-group/radio-row-group.css +0 -1
  140. package/dist/panel/components/ui/sheet/sheet.css +1 -1
  141. package/dist/panel/components/ui/sonner/sonner.css +1 -1
  142. package/dist/panel/components/ui/switch/switch.css +0 -2
  143. package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
  144. package/dist/panel/components/ui/tabs/tabs.css +2 -1
  145. package/dist/panel/components/ui/tag/tag.svelte +1 -1
  146. package/dist/panel/components/ui/tree/tree-rows.css +3 -3
  147. package/dist/panel/context/collection.svelte.d.ts +2 -2
  148. package/dist/panel/context/config.svelte.d.ts +2 -2
  149. package/dist/panel/context/documentForm.svelte.js +1 -1
  150. package/dist/panel/index.d.ts +3 -5
  151. package/dist/panel/index.js +4 -6
  152. package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +1 -1
  153. package/dist/panel/pages/dashboard/Dashboard.svelte +1 -1
  154. package/dist/panel/pages/dashboard/DashboardCard.svelte +2 -2
  155. package/dist/panel/pages/dashboard/DashboardCollection.svelte +1 -1
  156. package/dist/panel/pages/dashboard/DashboardRow.svelte +1 -1
  157. package/dist/panel/public.d.ts +4 -0
  158. package/dist/panel/public.js +6 -0
  159. package/dist/panel/style/index.css +13 -37
  160. package/dist/panel/style/mixins/index.css +1 -1
  161. package/dist/panel/style/palette.css +3 -3
  162. package/dist/panel/style/scheme.css +10 -34
  163. package/dist/public.d.ts +13 -0
  164. package/dist/public.js +12 -0
  165. package/package.json +12 -6
  166. package/dist/fields/blocks/component/focus/RenderPlaceholder.svelte +0 -77
  167. package/dist/fields/blocks/component/focus/Stage.svelte +0 -190
  168. package/dist/fields/blocks/component/focus/Stage.svelte.d.ts +0 -8
  169. package/dist/fields/relation/client.d.ts +0 -28
  170. package/dist/fields/relation/client.js +0 -37
  171. /package/dist/{panel/util → fields/relation}/populate.d.ts +0 -0
  172. /package/dist/{panel/util → fields/relation}/populate.js +0 -0
  173. /package/dist/{panel/components/sections/live → live}/LiveEdit.svelte.d.ts +0 -0
  174. /package/dist/{panel/components/sections/live → live}/Provider.svelte.d.ts +0 -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 a stage card: a hairline, no second fill. */
201
- :global(:is(.rz-group-field__content, .rz-block__fields, .rz-stage__fields)) .rz-tree-item {
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
  }
package/dist/index.d.ts CHANGED
@@ -1,14 +1,7 @@
1
- import { getI18nContext, setI18nContext } from './core/i18n/context.js';
2
- import i18n, { createI18n, t__ } from './core/i18n/index.js';
3
- import { cache } from './core/plugins/cache/index.js';
4
- import { openSse } from './core/plugins/sse/index.js';
5
- import LiveConsumer from './panel/components/sections/live/Consumer.svelte';
6
- import LiveEdit from './panel/components/sections/live/LiveEdit.svelte';
7
- import LiveProvider from './panel/components/sections/live/Provider.svelte';
1
+ import i18n, { t__ } from './core/i18n/index.js';
8
2
  export type { Dictionaries, I18n, PanelLanguage, Translate } from './core/i18n/index.js';
9
3
  export { definePlugin } from './core/plugins/index.js';
10
- export type { SSEEvent, SSEHandler } from './core/plugins/sse/index.js';
11
- export { cache, createI18n, getI18nContext, i18n, LiveConsumer, LiveEdit, LiveProvider, openSse, setI18nContext, t__ };
4
+ export { i18n, t__ };
12
5
  declare module 'rimecms' {
13
6
  interface RegisterCollection {
14
7
  }
package/dist/index.js CHANGED
@@ -1,9 +1,4 @@
1
- import { getI18nContext, setI18nContext } from './core/i18n/context.js';
2
- import i18n, { createI18n, t__ } from './core/i18n/index.js';
3
- import { cache } from './core/plugins/cache/index.js';
4
- import { openSse } from './core/plugins/sse/index.js';
5
- import LiveConsumer from './panel/components/sections/live/Consumer.svelte';
6
- import LiveEdit from './panel/components/sections/live/LiveEdit.svelte';
7
- import LiveProvider from './panel/components/sections/live/Provider.svelte';
1
+ // rimecms: what a config and the panel import. A site page imports rimecms/public.
2
+ import i18n, { t__ } from './core/i18n/index.js';
8
3
  export { definePlugin } from './core/plugins/index.js';
9
- export { cache, createI18n, getI18nContext, i18n, LiveConsumer, LiveEdit, LiveProvider, openSse, setI18nContext, t__ };
4
+ export { i18n, t__ };
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" generics="T">
2
- import { getLiveContext } from '../../../context/live.svelte.js';
3
- import type { WithRelationPopulated } from '../../../../core/fields/types.js';
2
+ import { getLiveContext } from './context.svelte.js';
3
+ import type { WithRelationPopulated } from '../core/fields/types.js';
4
4
  import type { Snippet } from 'svelte';
5
5
 
6
6
  let { child, data } = $props<{
@@ -1,4 +1,4 @@
1
- import type { WithRelationPopulated } from '../../../../core/fields/types.js';
1
+ import type { WithRelationPopulated } from '../core/fields/types.js';
2
2
  import type { Snippet } from 'svelte';
3
3
  declare function $$render<T>(): {
4
4
  props: {
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" generics="T">
2
2
  import { browser } from '$app/environment';
3
3
  import { page } from '$app/state';
4
- import { getLiveContext } from '../../../context/live.svelte.js';
5
- import { normalizeFieldPath } from '../../../../util/string.js';
4
+ import { getLiveContext } from './context.svelte.js';
5
+ import { normalizeFieldPath } from '../util/string.js';
6
6
  import { onDestroy, type Snippet } from 'svelte';
7
7
 
8
8
  type Props = {
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { beforeNavigate } from '$app/navigation';
3
3
  import { page } from '$app/state';
4
- import { setLiveContext } from '../../../context/live.svelte.js';
4
+ import { setLiveContext } from './context.svelte.js';
5
5
  import { onMount, type Snippet } from 'svelte';
6
6
 
7
7
  const { children }: { children: Snippet } = $props();
@@ -1,4 +1,4 @@
1
- import type { GenericDoc } from '../../core/prototype/types.js';
1
+ import type { GenericDoc } from '../core/prototype/types.js';
2
2
  import type { BeforeNavigate } from '@sveltejs/kit';
3
3
  export declare const LIVE_KEY: unique symbol;
4
4
  /**
@@ -1,9 +1,9 @@
1
1
  import { page } from '$app/state';
2
2
  import { env } from '$env/dynamic/public';
3
- import { PARAMS } from '../../core/constants.js';
3
+ import { PARAMS } from '../core/constants.js';
4
4
  import { getContext, setContext } from 'svelte';
5
- import { getValueAtPath, setValueAtPath } from '../../util/object.js';
6
- import { populate } from '../util/populate.js';
5
+ import { getValueAtPath, setValueAtPath } from '../util/object.js';
6
+ import { populate } from '../fields/relation/populate.js';
7
7
  export const LIVE_KEY = Symbol('rime.live');
8
8
  function createStore(href) {
9
9
  let enabled = $state(false);
@@ -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 a stage card: a hairline, no second fill. */
37
- :is(.rz-group-field__content, .rz-block__fields, .rz-tree-item__fields, .rz-stage__fields)
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-stage__fields)
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
 
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  .rz-upload-preview-cell {
50
- --size: var(--rz-upload-preview-cell-size, var(--rz-size-9));
50
+ --size: var(--rz-upload-preview-cell-size, var(--rz-size-8));
51
51
  display: flex;
52
52
  width: var(--size);
53
53
  height: var(--size);
@@ -42,7 +42,7 @@
42
42
  </Button>
43
43
  {/if}
44
44
 
45
- <style>/* A level: its fill, a hairline, its shadow. raised, float. */
45
+ <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
46
46
 
47
47
  /* A well: an input, a track, a dropzone. Its edge shows on hover. */
48
48
 
@@ -55,7 +55,7 @@
55
55
  </Dialog.Content>
56
56
  </Dialog.Root>
57
57
 
58
- <style>/* A level: its fill, a hairline, its shadow. raised, float. */
58
+ <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
59
59
 
60
60
  /* A well: an input, a track, a dropzone. Its edge shows on hover. */
61
61
 
@@ -77,7 +77,7 @@
77
77
  </div>
78
78
  {/if}
79
79
 
80
- <style>/* A level: its fill, a hairline, its shadow. raised, float. */
80
+ <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
81
81
 
82
82
  /* A well: an input, a track, a dropzone. Its edge shows on hover. */
83
83
 
@@ -97,7 +97,7 @@
97
97
  background-color: var(--rz-bg-raised);
98
98
  box-shadow:
99
99
  0 0 0 1px var(--rz-border),
100
- var(--rz-shadow-raised);
100
+ var(--rz-shadow-raised, 0 0 transparent);
101
101
  display: grid;
102
102
  gap: var(--rz-size-5);
103
103
  padding: var(--rz-size-4) var(--rz-size-3-5);
@@ -86,7 +86,7 @@
86
86
  </div>
87
87
  {/if}
88
88
 
89
- <style>/* A level: its fill, a hairline, its shadow. raised, float. */
89
+ <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
90
90
 
91
91
  /* A well: an input, a track, a dropzone. Its edge shows on hover. */
92
92
 
@@ -122,7 +122,7 @@
122
122
  background-color: var(--rz-bg-float);
123
123
  box-shadow:
124
124
  0 0 0 1px var(--rz-border),
125
- var(--rz-shadow-float);
125
+ var(--rz-shadow-float, 0 0 transparent);
126
126
  }
127
127
  .rz-auto-save-banner__actions {
128
128
  display: flex;
@@ -103,7 +103,7 @@
103
103
  </Dialog.Content>
104
104
  </Dialog.Root>
105
105
 
106
- <style>/* A level: its fill, a hairline, its shadow. raised, float. */
106
+ <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
107
107
 
108
108
  /* A well: an input, a track, a dropzone. Its edge shows on hover. */
109
109
 
@@ -106,7 +106,7 @@
106
106
  </Dialog.Content>
107
107
  </Dialog.Root>
108
108
 
109
- <style>/* A level: its fill, a hairline, its shadow. raised, float. */
109
+ <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
110
110
 
111
111
  /* A well: an input, a track, a dropzone. Its edge shows on hover. */
112
112
 
@@ -73,7 +73,7 @@
73
73
  </section>
74
74
  {/if}
75
75
 
76
- <style>/* A level: its fill, a hairline, its shadow. raised, float. */
76
+ <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
77
77
 
78
78
  /* A well: an input, a track, a dropzone. Its edge shows on hover. */
79
79
 
@@ -129,7 +129,7 @@
129
129
  background-color: var(--rz-bg-raised);
130
130
  box-shadow:
131
131
  0 0 0 1px var(--rz-border),
132
- var(--rz-shadow-raised);
132
+ var(--rz-shadow-raised, 0 0 transparent);
133
133
  display: grid;
134
134
  overflow: hidden;
135
135
  border-radius: var(--rz-radius-lg);