rimecms 0.26.6 → 0.26.8
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/adapter-sqlite/where.js +7 -1
- package/dist/core/areas/api/get.server.js +6 -2
- package/dist/core/collections/nested/hooks/index.server.js +3 -1
- package/dist/core/collections/upload/upload.d.ts +8 -8
- package/dist/core/collections/upload/util/path.js +2 -1
- package/dist/core/config/types.d.ts +1 -1
- package/dist/core/dev/generate/sanitize/index.js +707 -707
- package/dist/core/errors/handler.server.js +3 -3
- package/dist/core/fields/util.js +2 -1
- package/dist/core/i18n/en/common.js +60 -60
- package/dist/core/i18n/en/errors.js +13 -12
- package/dist/core/i18n/en/fields.js +11 -11
- package/dist/core/i18n/en/mail.js +2 -2
- package/dist/core/i18n/fr/common.js +64 -64
- package/dist/core/i18n/fr/errors.js +11 -11
- package/dist/core/i18n/fr/fields.js +11 -11
- package/dist/core/i18n/fr/mail.js +2 -2
- package/dist/core/logger/index.server.js +136 -136
- package/dist/core/operations/hooks/before-upsert/validate-fields.server.js +5 -5
- package/dist/core/plugins/cache/HeaderButton.svelte +11 -11
- package/dist/fields/blocks/component/AddBlockButton.svelte +161 -161
- package/dist/fields/blocks/component/Block.svelte +157 -157
- package/dist/fields/blocks/component/BlockActions.svelte +36 -36
- package/dist/fields/blocks/component/Blocks.svelte +154 -154
- package/dist/fields/blocks/component/Cell.svelte +12 -12
- package/dist/fields/blocks/component/ToggleBlockButton.svelte +11 -11
- package/dist/fields/checkbox/component/Checkbox.svelte +51 -51
- package/dist/fields/combobox/component/ComboBox.svelte +88 -88
- package/dist/fields/combobox/component/combobox.css +24 -24
- package/dist/fields/date/component/Cell.svelte +5 -5
- package/dist/fields/date/component/Date.svelte +92 -92
- package/dist/fields/email/component/Email.svelte +58 -58
- package/dist/fields/group/component/Group.svelte +131 -131
- package/dist/fields/link/component/Cell.svelte +9 -9
- package/dist/fields/link/component/Link.svelte +269 -269
- package/dist/fields/link/component/RessourceInput.svelte +183 -183
- package/dist/fields/number/component/Number.svelte +118 -118
- package/dist/fields/number/component/number.css +52 -52
- package/dist/fields/radio/component/Radio.svelte +56 -53
- package/dist/fields/relation/component/Cell.svelte +51 -51
- package/dist/fields/relation/component/Relation.svelte +226 -227
- package/dist/fields/relation/component/default/Default.svelte +218 -218
- package/dist/fields/relation/component/upload/Browse.svelte +227 -227
- package/dist/fields/relation/component/upload/Upload.svelte +112 -112
- package/dist/fields/relation/component/upload/upload.css +72 -72
- package/dist/fields/rich-text/component/Cell.svelte +5 -5
- package/dist/fields/rich-text/component/RichText.svelte +95 -95
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.css +15 -15
- package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte +148 -148
- package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.css +10 -10
- package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.svelte +23 -17
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.css +37 -37
- package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.svelte +93 -89
- package/dist/fields/rich-text/component/drag-handle/drag-handle.css +12 -12
- package/dist/fields/rich-text/component/drag-handle/drag-handle.svelte +27 -27
- package/dist/fields/rich-text/component/styles/rich-text.css +142 -142
- package/dist/fields/rich-text/component/suggestion/suggestion.svelte +79 -79
- package/dist/fields/rich-text/core/extensions/current-node/current-node.css +3 -3
- package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.js +10 -7
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/cloneElement.js +4 -1
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/dragHandler.js +4 -4
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/findNextElementFromCursor.js +4 -4
- package/dist/fields/rich-text/core/extensions/drag-handle/helpers/getInnerCoords.js +1 -1
- package/dist/fields/rich-text/core/features/fields/fields.css +16 -16
- package/dist/fields/rich-text/core/features/fields/fields.svelte +50 -50
- package/dist/fields/rich-text/core/features/hr/hr.css +15 -15
- package/dist/fields/rich-text/core/features/link/component/link-selector.css +2 -2
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +266 -266
- package/dist/fields/rich-text/core/features/resource/resource.svelte +135 -138
- package/dist/fields/rich-text/core/features/upload/upload.svelte +231 -235
- package/dist/fields/rich-text/core/render-rich-text.svelte +162 -162
- package/dist/fields/rich-text/core/svelte/node-view-wrapper.svelte +25 -18
- package/dist/fields/rich-text/util.js +2 -1
- package/dist/fields/select/component/Select.svelte +194 -194
- package/dist/fields/separator/component/Separator.svelte +5 -5
- package/dist/fields/slug/component/Cell.svelte +4 -4
- package/dist/fields/slug/component/Slug.svelte +99 -99
- package/dist/fields/tabs/component/Tabs.svelte +96 -96
- package/dist/fields/text/component/Text.svelte +54 -54
- package/dist/fields/textarea/component/TextArea.svelte +51 -51
- package/dist/fields/time/component/Time.svelte +44 -44
- package/dist/fields/toggle/component/Cell.svelte +10 -10
- package/dist/fields/toggle/component/Toggle.svelte +36 -36
- package/dist/fields/tree/component/AddItemButton.svelte +35 -29
- package/dist/fields/tree/component/Cell.svelte +12 -12
- package/dist/fields/tree/component/ToggleBlockButton.svelte +11 -11
- package/dist/fields/tree/component/Tree.svelte +150 -150
- package/dist/fields/tree/component/TreeBlock.svelte +174 -174
- package/dist/fields/tree/component/TreeBlockActions.svelte +13 -13
- package/dist/fields/tree/index.js +3 -2
- package/dist/live.d.ts +2 -2
- package/dist/live.js +2 -2
- package/dist/panel/components/Root.svelte +70 -70
- package/dist/panel/components/fields/Error.svelte +35 -35
- package/dist/panel/components/fields/FieldsPreview.svelte +71 -71
- package/dist/panel/components/fields/FieldsPreviewTrigger.svelte +11 -11
- package/dist/panel/components/fields/Hint.svelte +12 -12
- package/dist/panel/components/fields/Label.svelte +31 -26
- package/dist/panel/components/fields/LabelFor.svelte +26 -26
- package/dist/panel/components/fields/RenderFields.svelte +102 -102
- package/dist/panel/components/sections/auth/AuthForm.svelte +102 -102
- package/dist/panel/components/sections/collection/Empty.svelte +18 -18
- package/dist/panel/components/sections/collection/StatusDot.svelte +13 -13
- package/dist/panel/components/sections/collection/bulk-upload/BulkUploadDialog.svelte +30 -28
- package/dist/panel/components/sections/collection/bulk-upload/DropZone.svelte +176 -169
- package/dist/panel/components/sections/collection/folder/Folder.svelte +38 -38
- package/dist/panel/components/sections/collection/folder/FolderEdit.svelte +57 -57
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +223 -223
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +102 -102
- package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +50 -50
- package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +56 -56
- package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +29 -29
- package/dist/panel/components/sections/collection/header/DisplayMode.svelte +59 -59
- package/dist/panel/components/sections/collection/header/Header.svelte +11 -11
- package/dist/panel/components/sections/collection/header/SearchInput.svelte +41 -41
- package/dist/panel/components/sections/collection/header/SelectUI.svelte +51 -51
- package/dist/panel/components/sections/collection/header/Separator.svelte +4 -4
- package/dist/panel/components/sections/collection/list/CollectionList.svelte +46 -46
- package/dist/panel/components/sections/collection/list/header/Header.svelte +56 -56
- package/dist/panel/components/sections/collection/list/row/Row.svelte +115 -115
- package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +139 -139
- package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +56 -56
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +64 -64
- package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +66 -66
- package/dist/panel/components/sections/document/AuthFooter.svelte +81 -81
- package/dist/panel/components/sections/document/ButtonSave.svelte +34 -27
- package/dist/panel/components/sections/document/ButtonStatus.svelte +79 -79
- package/dist/panel/components/sections/document/CurrentlyEdited.svelte +36 -36
- package/dist/panel/components/sections/document/Document.svelte +223 -223
- package/dist/panel/components/sections/document/FloatingUI.svelte +69 -69
- package/dist/panel/components/sections/document/Header.svelte +105 -105
- package/dist/panel/components/sections/document/Settings.svelte +167 -167
- package/dist/panel/components/sections/document/Versions.svelte +89 -89
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +205 -205
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +141 -141
- package/dist/panel/components/sections/live/Consumer.svelte +14 -14
- package/dist/panel/components/sections/live/Provider.svelte +10 -10
- package/dist/panel/components/sections/live/SidePanel.svelte +56 -56
- package/dist/panel/components/sections/live/side-panel.css +10 -8
- package/dist/panel/components/sections/page-layout/Page.svelte +23 -23
- package/dist/panel/components/sections/unauthorized/Unauthorized.svelte +22 -22
- package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +40 -40
- package/dist/panel/components/ui/button/button.svelte +226 -226
- package/dist/panel/components/ui/calendar/calendar-cell.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-day.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-grid-body.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-grid-head.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-grid-row.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-grid.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-head-cell.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-header.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-heading.svelte +6 -2
- package/dist/panel/components/ui/calendar/calendar-months.svelte +21 -16
- package/dist/panel/components/ui/calendar/calendar-next-button.svelte +13 -8
- package/dist/panel/components/ui/calendar/calendar-prev-button.svelte +13 -8
- package/dist/panel/components/ui/calendar/calendar.css +88 -88
- package/dist/panel/components/ui/calendar/calendar.svelte +50 -50
- package/dist/panel/components/ui/card/card-content.svelte +17 -12
- package/dist/panel/components/ui/card/card-description.svelte +14 -9
- package/dist/panel/components/ui/card/card-footer.svelte +17 -12
- package/dist/panel/components/ui/card/card-header.svelte +15 -10
- package/dist/panel/components/ui/card/card-title.svelte +25 -19
- package/dist/panel/components/ui/card/card.svelte +19 -14
- package/dist/panel/components/ui/card-document/card-document.svelte +73 -73
- package/dist/panel/components/ui/card-resource/card-resource.svelte +108 -108
- package/dist/panel/components/ui/checkbox/checkbox.css +28 -28
- package/dist/panel/components/ui/checkbox/checkbox.svelte +13 -13
- package/dist/panel/components/ui/command/command-dialog.css +24 -24
- package/dist/panel/components/ui/command/command-dialog.svelte +28 -18
- package/dist/panel/components/ui/command/command-empty.css +2 -2
- package/dist/panel/components/ui/command/command-empty.svelte +7 -3
- package/dist/panel/components/ui/command/command-group.css +20 -20
- package/dist/panel/components/ui/command/command-group.svelte +17 -17
- package/dist/panel/components/ui/command/command-input-select.svelte +50 -45
- package/dist/panel/components/ui/command/command-input.svelte +57 -57
- package/dist/panel/components/ui/command/command-item.css +18 -18
- package/dist/panel/components/ui/command/command-item.svelte +7 -3
- package/dist/panel/components/ui/command/command-list.css +4 -4
- package/dist/panel/components/ui/command/command-list.svelte +7 -3
- package/dist/panel/components/ui/command/command-separator.css +4 -4
- package/dist/panel/components/ui/command/command-separator.svelte +7 -3
- package/dist/panel/components/ui/command/command.css +5 -5
- package/dist/panel/components/ui/command/command.svelte +8 -8
- package/dist/panel/components/ui/context-menu/ContextMenu.svelte +10 -5
- package/dist/panel/components/ui/context-menu/ContextMenu.svelte.d.ts +2 -2
- package/dist/panel/components/ui/context-menu/ContextMenuItem.svelte +8 -8
- package/dist/panel/components/ui/context-menu/context-menu-item.css +20 -20
- package/dist/panel/components/ui/context-menu/context-menu.css +12 -12
- package/dist/panel/components/ui/dialog/dialog-content.css +45 -45
- package/dist/panel/components/ui/dialog/dialog-content.svelte +33 -33
- package/dist/panel/components/ui/dialog/dialog-description.css +2 -2
- package/dist/panel/components/ui/dialog/dialog-description.svelte +7 -3
- package/dist/panel/components/ui/dialog/dialog-footer.svelte +20 -20
- package/dist/panel/components/ui/dialog/dialog-header.svelte +22 -22
- package/dist/panel/components/ui/dialog/dialog-overlay.css +6 -6
- package/dist/panel/components/ui/dialog/dialog-overlay.svelte +7 -3
- package/dist/panel/components/ui/dialog/dialog-title.css +3 -3
- package/dist/panel/components/ui/dialog/dialog-title.svelte +7 -3
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +55 -55
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +8 -8
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.svelte +14 -9
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.css +5 -5
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +10 -10
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.css +19 -19
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.svelte +9 -9
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-radio-item.css +17 -17
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +17 -17
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-separator.css +3 -3
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-separator.svelte +12 -4
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +6 -2
- package/dist/panel/components/ui/input/input.svelte +93 -93
- package/dist/panel/components/ui/label/label.css +7 -7
- package/dist/panel/components/ui/label/label.svelte +8 -8
- package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte +48 -48
- package/dist/panel/components/ui/nav/Nav.svelte +151 -151
- package/dist/panel/components/ui/nav/NavGroup.svelte +85 -85
- package/dist/panel/components/ui/nav/NavItem.svelte +42 -42
- package/dist/panel/components/ui/nav/NavItemButton.svelte +39 -38
- package/dist/panel/components/ui/nav/NavItemButtonCaret.svelte +8 -8
- package/dist/panel/components/ui/nav/UserButton.svelte +90 -90
- package/dist/panel/components/ui/page-header/PageHeader.svelte +80 -80
- package/dist/panel/components/ui/pane/pane-resizer.svelte +12 -12
- package/dist/panel/components/ui/popover/popover-content.css +7 -7
- package/dist/panel/components/ui/popover/popover-content.svelte +16 -10
- package/dist/panel/components/ui/radio-group/radio-group-item.svelte +8 -7
- package/dist/panel/components/ui/radio-group/radio-group.css +23 -23
- package/dist/panel/components/ui/radio-group/radio-group.svelte +8 -8
- package/dist/panel/components/ui/radio-row-group/radio-row-group-item.svelte +9 -9
- package/dist/panel/components/ui/radio-row-group/radio-row-group.css +27 -27
- package/dist/panel/components/ui/radio-row-group/radio-row-group.svelte +14 -9
- package/dist/panel/components/ui/scroll-area/scroll-area-scrollbar.svelte +14 -14
- package/dist/panel/components/ui/scroll-area/scroll-area.css +21 -21
- package/dist/panel/components/ui/scroll-area/scroll-area.svelte +26 -26
- package/dist/panel/components/ui/separator/separator.svelte +25 -25
- package/dist/panel/components/ui/sheet/sheet-content.svelte +33 -33
- package/dist/panel/components/ui/sheet/sheet-description.svelte +6 -2
- package/dist/panel/components/ui/sheet/sheet-footer.svelte +10 -5
- package/dist/panel/components/ui/sheet/sheet-header.svelte +10 -5
- package/dist/panel/components/ui/sheet/sheet-overlay.svelte +7 -3
- package/dist/panel/components/ui/sheet/sheet-title.svelte +6 -2
- package/dist/panel/components/ui/sheet/sheet.css +81 -81
- package/dist/panel/components/ui/sheet/sheet.svelte +5 -5
- package/dist/panel/components/ui/sonner/sonner.css +12 -12
- package/dist/panel/components/ui/sonner/sonner.svelte +15 -15
- package/dist/panel/components/ui/spin-loader/SpinLoader.svelte +2 -2
- package/dist/panel/components/ui/spin-loader/spin-loader.css +10 -10
- package/dist/panel/components/ui/switch/switch.css +36 -36
- package/dist/panel/components/ui/switch/switch.svelte +9 -9
- package/dist/panel/components/ui/tabs/tabs-content.svelte +6 -2
- package/dist/panel/components/ui/tabs/tabs-list.svelte +2 -2
- package/dist/panel/components/ui/tabs/tabs-trigger.svelte +6 -2
- package/dist/panel/components/ui/tabs/tabs.css +47 -49
- package/dist/panel/components/ui/tabs/tabs.svelte +5 -5
- package/dist/panel/components/ui/tag/tag.svelte +49 -45
- package/dist/panel/components/ui/tooltip/tooltip-content.svelte +31 -31
- package/dist/panel/context/api-proxy.svelte.d.ts +12 -11
- package/dist/panel/context/api-proxy.svelte.js +6 -5
- package/dist/panel/pages/area/Area.svelte +17 -17
- package/dist/panel/pages/area/AreaVersionsDoc.svelte +19 -19
- package/dist/panel/pages/area/load.server.js +10 -2
- package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +58 -54
- package/dist/panel/pages/auth/reset-password/ResetPassword.svelte +54 -54
- package/dist/panel/pages/auth/sign-in/SignIn.svelte +41 -41
- package/dist/panel/pages/collection/Collection.svelte +121 -121
- package/dist/panel/pages/collection/load.server.js +8 -2
- package/dist/panel/pages/collection-document/CollectionDocVersions.svelte +26 -26
- package/dist/panel/pages/collection-document/CollectionDocument.svelte +20 -20
- package/dist/panel/pages/collection-document/actions.server.js +3 -1
- package/dist/panel/pages/collection-document/load.server.js +4 -1
- package/dist/panel/pages/dashboard/Dashboard.svelte +109 -109
- package/dist/panel/pages/index.actions.server.js +1 -1
- package/dist/panel/pages/index.load.server.js +1 -1
- package/dist/panel/pages/live/Live.svelte +199 -192
- package/dist/panel/style/font.css +32 -32
- package/dist/panel/style/index.css +81 -81
- package/dist/panel/style/palette.css +27 -28
- package/dist/panel/style/radius.css +8 -8
- package/dist/panel/style/shadow.css +8 -8
- package/dist/panel/style/size.css +41 -41
- package/dist/panel/style/util.css +1 -1
- package/dist/util/cases.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,54 +1,58 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { X } from '@lucide/svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type Props = { readOnly: boolean; children: Snippet; onRemove: () => void };
|
|
6
|
+
const { readOnly, children, onRemove }: Props = $props();
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<div class="rz-tag" class:rz-tag--readonly={readOnly}>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
<span>
|
|
11
|
+
{@render children?.()}
|
|
12
|
+
</span>
|
|
13
|
+
<button
|
|
14
|
+
class="rz-tag__button"
|
|
15
|
+
class:rz-tag__button--readonly={readOnly}
|
|
16
|
+
type="button"
|
|
17
|
+
onclick={onRemove}
|
|
18
|
+
>
|
|
19
|
+
<X size={13} />
|
|
20
|
+
</button>
|
|
16
21
|
</div>
|
|
17
22
|
|
|
18
23
|
<style global>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
24
|
+
:root {
|
|
25
|
+
--tag-color-bg: hsl(var(--rz-gray-0));
|
|
26
|
+
--tag-color-fg: hsl(var(--rz-gray-13));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.rz-tag {
|
|
30
|
+
background-color: var(--tag-color-bg);
|
|
31
|
+
color: var(--tag-color-fg);
|
|
32
|
+
border-radius: var(--rz-radius-sm);
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: var(--rz-size-2);
|
|
36
|
+
font-size: var(--rz-text-sm);
|
|
37
|
+
padding: 0.2rem var(--rz-size-2);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rz-tag--readonly {
|
|
41
|
+
opacity: 0.3;
|
|
42
|
+
cursor: no-drop;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.rz-tag__button {
|
|
46
|
+
border-radius: var(--rz-radius-sm);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.rz-tag__button:focus-visible {
|
|
51
|
+
outline: none;
|
|
52
|
+
background-color: hsl(var(--rz-color-ring));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.rz-tag__button--readonly {
|
|
56
|
+
cursor: no-drop;
|
|
57
|
+
}
|
|
54
58
|
</style>
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from 'bits-ui';
|
|
3
|
+
import { fly } from 'svelte/transition';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
sideOffset = 4,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: TooltipPrimitive.ContentProps = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<TooltipPrimitive.Content bind:ref forceMount {sideOffset} {...restProps}>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
{#snippet child({ wrapperProps, props, open })}
|
|
16
|
+
{#if open}
|
|
17
|
+
<div {...wrapperProps}>
|
|
18
|
+
<div {...props} class="rz-tooltip {className}" transition:fly={{ duration: 300 }}>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
{/if}
|
|
23
|
+
{/snippet}
|
|
24
24
|
</TooltipPrimitive.Content>
|
|
25
25
|
|
|
26
26
|
<style>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
:root {
|
|
28
|
+
--rz-tooltip-color-fg: light-dark(hsl(var(--rz-gray-16)), hsl(var(--rz-gray-2)));
|
|
29
|
+
--rz-tooltip-color-bg: light-dark(hsl(var(--rz-gray-0)), hsl(var(--rz-gray-11)));
|
|
30
|
+
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
.rz-tooltip {
|
|
33
|
+
background-color: var(--rz-tooltip-color-bg);
|
|
34
|
+
color: var(--rz-tooltip-color-fg);
|
|
35
|
+
padding: var(--rz-size-1-5) var(--rz-size-3);
|
|
36
|
+
font-size: var(--rz-text-xs);
|
|
37
|
+
z-index: 200;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
border-radius: var(--rz-radius-md);
|
|
40
|
+
}
|
|
41
41
|
</style>
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
export type Resource<T = any> = {
|
|
2
|
-
data: T | null;
|
|
3
|
-
isLoading: boolean;
|
|
4
|
-
error: any;
|
|
5
|
-
url: string;
|
|
6
|
-
refresh: () => void;
|
|
7
|
-
};
|
|
8
|
-
type GetResourcesOptions<T> = {
|
|
9
|
-
transformData?: (input: any) => T;
|
|
10
|
-
};
|
|
11
1
|
export declare function setAPIProxyContext(key?: symbol): {
|
|
12
2
|
getRessource: <T>(url: string, options?: GetResourcesOptions<T>) => Resource<T>;
|
|
13
3
|
invalidateAll: () => void;
|
|
4
|
+
readonly urls: string[];
|
|
14
5
|
};
|
|
15
6
|
export declare function getAPIProxyContext(key?: symbol): {
|
|
16
7
|
getRessource: <T>(url: string, options?: GetResourcesOptions<T>) => Resource<T>;
|
|
17
8
|
invalidateAll: () => void;
|
|
9
|
+
readonly urls: string[];
|
|
18
10
|
};
|
|
19
11
|
export declare const API_PROXY: {
|
|
20
12
|
DOCUMENT: symbol;
|
|
21
13
|
ROOT: symbol;
|
|
22
|
-
|
|
14
|
+
};
|
|
15
|
+
export type Resource<T = any> = {
|
|
16
|
+
data: T | null;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
error: any;
|
|
19
|
+
url: string;
|
|
20
|
+
refresh: () => void;
|
|
21
|
+
};
|
|
22
|
+
type GetResourcesOptions<T> = {
|
|
23
|
+
transformData?: (input: any) => T;
|
|
23
24
|
};
|
|
24
25
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getContext, setContext } from 'svelte';
|
|
2
2
|
function createAPIProxy() {
|
|
3
|
-
// Use explicit type instead of ReturnType
|
|
4
3
|
const resources = $state(new Map());
|
|
5
4
|
function getRessource(url, options) {
|
|
6
5
|
// Check if we already have this resource
|
|
@@ -66,7 +65,10 @@ function createAPIProxy() {
|
|
|
66
65
|
}
|
|
67
66
|
return {
|
|
68
67
|
getRessource,
|
|
69
|
-
invalidateAll
|
|
68
|
+
invalidateAll,
|
|
69
|
+
get urls() {
|
|
70
|
+
return Array.from(resources.entries()).map(([url, resource]) => url);
|
|
71
|
+
}
|
|
70
72
|
};
|
|
71
73
|
}
|
|
72
74
|
export function setAPIProxyContext(key = API_PROXY.ROOT) {
|
|
@@ -76,9 +78,8 @@ export function setAPIProxyContext(key = API_PROXY.ROOT) {
|
|
|
76
78
|
export function getAPIProxyContext(key = API_PROXY.ROOT) {
|
|
77
79
|
return getContext(key);
|
|
78
80
|
}
|
|
79
|
-
// @TODO why multiple APIProxy ROOT everywhere should work
|
|
81
|
+
// @TODO why multiple APIProxy... ROOT everywhere should work
|
|
80
82
|
export const API_PROXY = {
|
|
81
83
|
DOCUMENT: Symbol('api-proxy.document'),
|
|
82
|
-
ROOT: Symbol('api-proxy.root')
|
|
83
|
-
TIPTAP: Symbol('api-proxy.tiptap')
|
|
84
|
+
ROOT: Symbol('api-proxy.root')
|
|
84
85
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import Document from '../../components/sections/document/Document.svelte';
|
|
3
|
+
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
4
|
+
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte.js';
|
|
5
|
+
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
6
|
+
import type { AreaDocData } from '../../index.js';
|
|
7
|
+
|
|
8
|
+
const { data }: { data: AreaDocData<false> } = $props();
|
|
9
|
+
|
|
10
|
+
setAPIProxyContext(API_PROXY.DOCUMENT);
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
{#if data.status === 200}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
<Page>
|
|
15
|
+
{#snippet main()}
|
|
16
|
+
{#key data.doc.id + data.doc.versionId || '' + data.doc.locale || ''}
|
|
17
|
+
<Document doc={data.doc} readOnly={data.readOnly} operation="update" />
|
|
18
|
+
{/key}
|
|
19
|
+
{/snippet}
|
|
20
|
+
</Page>
|
|
21
21
|
{:else}
|
|
22
|
-
|
|
22
|
+
<Unauthorized />
|
|
23
23
|
{/if}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import Document from '../../components/sections/document/Document.svelte';
|
|
3
|
+
import Versions from '../../components/sections/document/Versions.svelte';
|
|
4
|
+
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
5
|
+
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
6
|
+
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte.js';
|
|
7
|
+
import type { AreaDocData } from '../../index.js';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const { data }: { data: AreaDocData<true> } = $props();
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
setAPIProxyContext(API_PROXY.DOCUMENT);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
{#if data.status === 200}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
{#key data.doc.id + data.doc.versionId || '' + data.doc.locale || ''}
|
|
16
|
+
<Page>
|
|
17
|
+
{#snippet main()}
|
|
18
|
+
<Document doc={data.doc} operation={data.operation} readOnly={data.readOnly} />
|
|
19
|
+
{/snippet}
|
|
20
|
+
{#snippet aside()}
|
|
21
|
+
<Versions doc={data.doc} versions={data.versions} />
|
|
22
|
+
{/snippet}
|
|
23
|
+
</Page>
|
|
24
|
+
{/key}
|
|
25
25
|
{:else}
|
|
26
|
-
|
|
26
|
+
<Unauthorized />
|
|
27
27
|
{/if}
|
|
@@ -17,10 +17,18 @@ export default function (slug, withVersions) {
|
|
|
17
17
|
{ title: area.config.label }
|
|
18
18
|
];
|
|
19
19
|
if (!authorizedRead) {
|
|
20
|
-
return {
|
|
20
|
+
return {
|
|
21
|
+
aria,
|
|
22
|
+
doc: {},
|
|
23
|
+
operation: 'update',
|
|
24
|
+
status: 401,
|
|
25
|
+
readOnly: true
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
const versionId = url.searchParams.get(PARAMS.VERSION_ID) || undefined;
|
|
23
|
-
const draft = url.searchParams.get(PARAMS.DRAFT)
|
|
29
|
+
const draft = url.searchParams.get(PARAMS.DRAFT)
|
|
30
|
+
? url.searchParams.get(PARAMS.DRAFT) === 'true'
|
|
31
|
+
: undefined;
|
|
24
32
|
const doc = await area.find({ locale, versionId, draft });
|
|
25
33
|
if (!authorizedUpdate) {
|
|
26
34
|
return { aria, doc, operation: 'update', status: 200, readOnly: true };
|
|
@@ -1,61 +1,65 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
2
|
+
import { t__ } from '../../../../core/i18n/index.js';
|
|
3
|
+
import Email from '../../../../fields/email/component/Email.svelte';
|
|
4
|
+
import AuthForm from '../../../components/sections/auth/AuthForm.svelte';
|
|
5
|
+
import Button from '../../../components/ui/button/button.svelte';
|
|
6
|
+
import { setFormContext } from '../../../context/form.svelte';
|
|
7
|
+
import { emailField } from '../fields.js';
|
|
8
|
+
import { authClient } from '../../../util/auth';
|
|
9
|
+
import { toast } from 'svelte-sonner';
|
|
10
|
+
|
|
11
|
+
type Props = {
|
|
12
|
+
data: {
|
|
13
|
+
image: string | null;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const { data }: Props = $props();
|
|
17
|
+
|
|
18
|
+
const context = setFormContext({}, 'login');
|
|
19
|
+
|
|
20
|
+
let success = $state(false);
|
|
21
|
+
|
|
22
|
+
$effect(() => {
|
|
23
|
+
const formError = context.errors.get('_form');
|
|
24
|
+
if (typeof formError === 'string') {
|
|
25
|
+
toast.error(t__(`errors.${formError}`));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
async function sendResetPasswordMail() {
|
|
30
|
+
const { data, error } = await authClient.requestPasswordReset({
|
|
31
|
+
email: context.values.email,
|
|
32
|
+
redirectTo: `/reset-password`
|
|
33
|
+
});
|
|
34
|
+
if (error && error.message) {
|
|
35
|
+
toast.error(error.message);
|
|
36
|
+
}
|
|
37
|
+
if (data && data.status) {
|
|
38
|
+
success = data.status;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
42
41
|
</script>
|
|
43
42
|
|
|
44
43
|
<AuthForm image={data.image} title={t__('common.forgotPassword')}>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
{#if success}
|
|
45
|
+
<p>{t__('common.passwordResetLinkSent', context.values.email)}</p>
|
|
46
|
+
{:else}
|
|
47
|
+
<Email config={emailField} form={context} />
|
|
48
|
+
<Button size="xl" disabled={!context.canSubmit} onclick={sendResetPasswordMail}>
|
|
49
|
+
{t__('common.requestPasswordReset')}
|
|
50
|
+
</Button>
|
|
51
|
+
{/if}
|
|
53
52
|
</AuthForm>
|
|
54
53
|
|
|
55
|
-
<style
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
<style>/**************************************/
|
|
55
|
+
|
|
56
|
+
/* Font */
|
|
57
|
+
|
|
58
|
+
/**************************************/
|
|
59
|
+
|
|
60
|
+
p {
|
|
61
|
+
font-size: var(--rz-text-lg);
|
|
62
|
+
font-variation-settings: 'wght' 600;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
}
|
|
61
65
|
</style>
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { t__ } from '../../../../core/i18n';
|
|
3
|
+
import Text from '../../../../fields/text/component/Text.svelte';
|
|
4
|
+
import AuthForm from '../../../components/sections/auth/AuthForm.svelte';
|
|
5
|
+
import Button from '../../../components/ui/button/button.svelte';
|
|
6
|
+
import { setFormContext } from '../../../context/form.svelte';
|
|
7
|
+
import { passwordField } from '../fields.js';
|
|
8
|
+
import { authClient } from '../../../util/auth';
|
|
9
|
+
import { toast } from 'svelte-sonner';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
let success = $state(false);
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const form = setFormContext({}, 'reset-password');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
type Props = {
|
|
16
|
+
data: {
|
|
17
|
+
image: string | null;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const { data }: Props = $props();
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
const passwordConfig = {
|
|
23
|
+
...passwordField,
|
|
24
|
+
placeholder: t__('common.newPassword')
|
|
25
|
+
};
|
|
26
|
+
const confirmPasswordConfig = {
|
|
27
|
+
...passwordField,
|
|
28
|
+
name: 'confirmPassword',
|
|
29
|
+
placeholder: t__('common.confirmPassword')
|
|
30
|
+
};
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
async function resetPassword() {
|
|
33
|
+
const token = new URLSearchParams(window.location.search).get('token');
|
|
34
|
+
if (!token) {
|
|
35
|
+
return toast.error('An error occured');
|
|
36
|
+
}
|
|
37
|
+
const { data, error } = await authClient.resetPassword({
|
|
38
|
+
newPassword: form.values.password,
|
|
39
|
+
token
|
|
40
|
+
});
|
|
41
|
+
if (error) {
|
|
42
|
+
console.error(error);
|
|
43
|
+
return toast.error(error.message || 'An error occured');
|
|
44
|
+
}
|
|
45
|
+
success = data?.status;
|
|
46
|
+
}
|
|
47
47
|
</script>
|
|
48
48
|
|
|
49
49
|
<AuthForm image={data.image} title={t__('common.resetPassword')}>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
{#if success}
|
|
51
|
+
<p>{t__('common.reset_password_success')}</p>
|
|
52
|
+
<Button size="xl" href="/panel/sign-in">{t__('common.signin')}</Button>
|
|
53
|
+
{:else}
|
|
54
|
+
<Text type="password" config={passwordConfig} {form} />
|
|
55
|
+
<Text type="password" config={confirmPasswordConfig} {form} />
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
<Button
|
|
58
|
+
size="xl"
|
|
59
|
+
disabled={!(form.canSubmit && form.values.password && form.values.confirmPassword)}
|
|
60
|
+
onclick={resetPassword}
|
|
61
|
+
>
|
|
62
|
+
{t__('common.resetPassword')}
|
|
63
|
+
</Button>
|
|
64
|
+
{/if}
|
|
65
65
|
</AuthForm>
|