rimecms 1.4.3 → 1.5.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.
Files changed (63) hide show
  1. package/dist/core/auth/better-auth/config.server.d.ts +1 -1
  2. package/dist/core/auth/better-auth/instance.server.d.ts +2 -2
  3. package/dist/core/boot.server.d.ts +2 -2
  4. package/dist/core/i18n/en/common.d.ts +10 -4
  5. package/dist/core/i18n/en/common.js +12 -6
  6. package/dist/core/i18n/fr/common.d.ts +10 -4
  7. package/dist/core/i18n/fr/common.js +12 -7
  8. package/dist/core/prototype/shared/title/find-title.d.ts +9 -0
  9. package/dist/core/prototype/shared/title/find-title.js +20 -4
  10. package/dist/fields/group/component/Group.svelte +4 -3
  11. package/dist/fields/radio/component/Radio.svelte +19 -1
  12. package/dist/fields/radio/index.d.ts +23 -6
  13. package/dist/fields/radio/index.js +13 -1
  14. package/dist/fields/text/index.d.ts +11 -3
  15. package/dist/fields/text/index.js +11 -3
  16. package/dist/panel/components/fields/RenderFields.svelte +3 -2
  17. package/dist/panel/components/sections/collection/DropHint.svelte +41 -0
  18. package/dist/panel/components/sections/collection/DropHint.svelte.d.ts +7 -0
  19. package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +23 -3
  20. package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +3 -3
  21. package/dist/panel/components/sections/collection/header/ButtonCreate.svelte.d.ts +1 -1
  22. package/dist/panel/components/sections/collection/list/CollectionList.svelte +8 -0
  23. package/dist/panel/components/sections/document/AutoSaveBanner.svelte +1 -1
  24. package/dist/panel/components/sections/document/ButtonPublish.svelte +39 -0
  25. package/dist/panel/components/sections/document/ButtonPublish.svelte.d.ts +7 -0
  26. package/dist/panel/components/sections/document/ButtonSave.svelte +6 -3
  27. package/dist/panel/components/sections/document/ButtonSave.svelte.d.ts +3 -1
  28. package/dist/panel/components/sections/document/Document.svelte +4 -13
  29. package/dist/panel/components/sections/document/DocumentChildren.svelte +1 -1
  30. package/dist/panel/components/sections/document/Header.svelte +116 -65
  31. package/dist/panel/components/sections/document/Settings.svelte +42 -125
  32. package/dist/panel/components/sections/document/VersionMenu.svelte +383 -0
  33. package/dist/panel/components/sections/document/VersionMenu.svelte.d.ts +8 -0
  34. package/dist/panel/components/sections/document/Versions.svelte +1 -1
  35. package/dist/panel/components/sections/document/Versions.svelte.d.ts +1 -1
  36. package/dist/panel/components/sections/document/version-status.d.ts +12 -0
  37. package/dist/panel/components/sections/document/version-status.js +33 -0
  38. package/dist/panel/components/sections/document/versions-list.d.ts +1 -1
  39. package/dist/panel/components/sections/document/versions-list.js +1 -1
  40. package/dist/panel/components/ui/calendar/calendar.svelte.d.ts +1 -1
  41. package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
  42. package/dist/panel/components/ui/page-header/PageHeader.svelte +39 -13
  43. package/dist/panel/components/ui/page-header/PageHeader.svelte.d.ts +4 -0
  44. package/dist/panel/components/ui/radio-card-group/index.d.ts +3 -0
  45. package/dist/panel/components/ui/radio-card-group/index.js +3 -0
  46. package/dist/panel/components/ui/radio-card-group/radio-card-group-item.svelte +30 -0
  47. package/dist/panel/components/ui/radio-card-group/radio-card-group-item.svelte.d.ts +9 -0
  48. package/dist/panel/components/ui/radio-card-group/radio-card-group.css +80 -0
  49. package/dist/panel/components/ui/radio-card-group/radio-card-group.svelte +18 -0
  50. package/dist/panel/components/ui/radio-card-group/radio-card-group.svelte.d.ts +5 -0
  51. package/dist/panel/components/ui/radio-row-group/radio-row-group.css +5 -3
  52. package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
  53. package/dist/panel/context/collection.svelte.d.ts +2 -2
  54. package/dist/panel/context/documentForm.svelte.d.ts +2 -0
  55. package/dist/panel/context/documentForm.svelte.js +12 -0
  56. package/dist/panel/context/versions.svelte.js +1 -1
  57. package/dist/panel/pages/collection/CollectionPage.svelte +37 -27
  58. package/dist/panel/pages/collection/CollectionPage.svelte.d.ts +1 -1
  59. package/dist/panel/style/index.css +0 -12
  60. package/dist/panel/style/scheme.css +0 -12
  61. package/package.json +1 -1
  62. package/dist/panel/components/sections/document/ButtonStatus.svelte +0 -158
  63. package/dist/panel/components/sections/document/ButtonStatus.svelte.d.ts +0 -7
@@ -42,13 +42,6 @@
42
42
 
43
43
  /* shadows: only what floats over the page casts one */
44
44
  --rz-shadow-float: 0 16px 36px -12px oklch(from var(--rz-gray-0) l c h / 0.16);
45
-
46
- /* gradients */
47
- --rz-glow: radial-gradient(
48
- 70% 38% at 50% 0%,
49
- oklch(from var(--rz-accent-solid) l c h / 0.035),
50
- transparent
51
- );
52
45
  }
53
46
 
54
47
  @media (prefers-color-scheme: dark) {
@@ -79,10 +72,5 @@
79
72
  --rz-ring: oklch(from var(--rz-accent-soft) l c h / 0.2);
80
73
 
81
74
  --rz-shadow-float: 0 16px 40px -12px oklch(from var(--rz-gray-0) l c h / 0.6);
82
- --rz-glow: radial-gradient(
83
- 70% 38% at 50% 0%,
84
- oklch(from var(--rz-accent-solid) l c h / 0.07),
85
- transparent
86
- );
87
75
  }
88
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimecms",
3
- "version": "1.4.3",
3
+ "version": "1.5.1",
4
4
  "homepage": "https://github.com/bienbiendev/rime",
5
5
  "packageManager": "bun@1.3.0",
6
6
  "scripts": {
@@ -1,158 +0,0 @@
1
- <script lang="ts">
2
- import { documentSegments } from '../../../util/url.js';
3
- import { invalidateAll } from '$app/navigation';
4
- import { PARAMS } from '../../../../core/constants.js';
5
- import { VERSIONS_STATUS } from '../../../../core/prototype/shared/versions/constant.js';
6
- import { apiUrl } from '../../../../core/routes/util.js';
7
- import * as Dialog from '../../ui/dialog/index.js';
8
- import * as Radio from '../../ui/radio-group/index.js';
9
- import { getAPIProxyContext } from '../../../context/api-proxy.svelte.js';
10
- import { useCommands } from '../../../context/commands.svelte.js';
11
- import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
12
- import { toast } from 'svelte-sonner';
13
- import { t__ } from '../../../../core/i18n/index.js';
14
- import Button from '../../ui/button/button.svelte';
15
- import Label from '../../ui/label/label.svelte';
16
- import StatusDot from '../collection/StatusDot.svelte';
17
- type Props = { form: DocumentFormContext };
18
- const { form }: Props = $props();
19
-
20
- const APIProxy = getAPIProxyContext();
21
- const statusList = Object.values(VERSIONS_STATUS);
22
-
23
- let dialogOpen = $state(false);
24
-
25
- /**
26
- * Sets the status of the row on screen (`?versionId=`), then takes it into the form without
27
- * dirtying it, reloads the page data and the version history.
28
- */
29
- async function handleValidateStatus(next: string = status) {
30
- const url = apiUrl(...documentSegments(form.config.kebab, form.values));
31
- await fetch(`${url}?${PARAMS.VERSION_ID}=${form.values.versionId}`, {
32
- method: 'PATCH',
33
- body: JSON.stringify({
34
- status: next
35
- })
36
- })
37
- .then((r) => {
38
- if (r.status === 200) {
39
- toast.success(t__('common.doc_updated'));
40
- // The server holds the new status already: the form takes it without getting dirty,
41
- // so no auto-save follows a publish.
42
- form.sync('status', next);
43
- dialogOpen = false;
44
- invalidateAll();
45
- // The write went around the form: the version history re-reads its statuses.
46
- // `apiUrl(kebab)` reaches `/api/<kebab>--versions` because `invalidate` matches by
47
- // substring (api-proxy.svelte.ts).
48
- APIProxy.invalidate(apiUrl(form.config.kebab));
49
- } else {
50
- toast.error(t__('common.generic_error'));
51
- }
52
- })
53
- .catch(() => {
54
- toast.error(t__('common.generic_error'));
55
- });
56
- }
57
-
58
- let status = $derived(form.values.status);
59
-
60
- /** Closes the dialog without Validate: the radio shows the document's status again. */
61
- function cancel() {
62
- status = form.values.status;
63
- dialogOpen = false;
64
- }
65
-
66
- /** The other statuses, one line each. */
67
- useCommands(() =>
68
- statusList
69
- .filter((candidate) => candidate !== form.values.status)
70
- .map((candidate) => ({
71
- id: `document.status.${candidate}`,
72
- label: t__('common.mark_as', t__(`common.${candidate}`)),
73
- group: t__('common.document'),
74
- run: () => handleValidateStatus(candidate)
75
- }))
76
- );
77
- </script>
78
-
79
- <Dialog.Root
80
- bind:open={dialogOpen}
81
- onOpenChange={(open) => {
82
- if (!open) cancel();
83
- }}
84
- >
85
- <Dialog.Trigger>
86
- {#snippet child({ props })}
87
- <Button size="sm" variant="ghost" class="rz-status__button" {...props}>
88
- <StatusDot status={form.values.status} />
89
- <span class="rz-status__text">{t__(`common.${form.values.status}`)}</span>
90
- </Button>
91
- {/snippet}
92
- </Dialog.Trigger>
93
- <Dialog.Content>
94
- <Radio.Root bind:value={status}>
95
- {#each statusList as status, index (index)}
96
- <div class="rz-radio__option">
97
- <Radio.Item id="document.{status}" value={status} />
98
- <Label for="document.{status}">
99
- {t__(`common.${status}`)}
100
- <p>{t__(`common.${status}_infos`)}</p>
101
- </Label>
102
- </div>
103
- {/each}
104
- </Radio.Root>
105
- <Dialog.Footer>
106
- <Button onclick={() => handleValidateStatus()} variant="outline" kbd="enter"
107
- >{t__('common.validate')}</Button
108
- >
109
- <Button onclick={cancel} variant="secondary" kbd="escape">
110
- {t__('common.cancel')}
111
- </Button>
112
- </Dialog.Footer>
113
- </Dialog.Content>
114
- </Dialog.Root>
115
-
116
- <style>/* A level: its fill, a hairline, and its shadow when it has one. raised has none, float does. */
117
-
118
- /* A well: an input, a track, a dropzone. Its edge shows on hover. */
119
-
120
- /* The hover tint, laid over the element's own fill. */
121
-
122
- /* The picked item of a segmented control. */
123
-
124
- /* The primary button's face: black on light, white on dark. */
125
-
126
- /* Keyboard focus on a button, a tab, a link. */
127
-
128
- /* A focused input: an accent edge and a soft halo. */
129
-
130
- /* An input with an error. */
131
- /* The status as a ghost button: a small dot, draft or published, then its name. */
132
- :global(.rz-status__button) {
133
- --rz-dot-size: var(--rz-size-1-5);
134
- }
135
-
136
- /* Each status a row: the radio, its name, a line on what it means. */
137
- .rz-radio__option {
138
- display: flex;
139
- align-items: flex-start;
140
- gap: var(--rz-size-3);
141
- padding: var(--rz-size-3) var(--rz-size-3-5);
142
- border-radius: var(--rz-radius-lg);
143
- box-shadow: 0 0 0 1px var(--rz-border);
144
-
145
- :global(.rz-label) {
146
- color: var(--rz-fg);
147
- font-size: var(--rz-text-md);
148
- }
149
-
150
- p {
151
- margin-top: var(--rz-size-0-5);
152
- color: var(--rz-fg-subtle);
153
- font-size: var(--rz-text-sm);
154
- font-variation-settings: 'wght' 400;
155
- font-weight: 400;
156
- }
157
- }
158
- </style>
@@ -1,7 +0,0 @@
1
- import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
2
- type Props = {
3
- form: DocumentFormContext;
4
- };
5
- declare const ButtonStatus: import("svelte").Component<Props, {}, "">;
6
- type ButtonStatus = ReturnType<typeof ButtonStatus>;
7
- export default ButtonStatus;