@velocity-astro/cms-ui 0.1.0-beta.1 → 0.1.0-beta.11
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/component-registry.json +93 -8
- package/dist/components/BarChart/BarChart.d.ts +23 -0
- package/dist/components/BarChart/BarChart.d.ts.map +1 -0
- package/dist/components/BarChart/BarChart.js +19 -0
- package/dist/components/BarChart/BarChart.js.map +1 -0
- package/dist/components/BarChart/BarChart.variants.d.ts +29 -0
- package/dist/components/BarChart/BarChart.variants.d.ts.map +1 -0
- package/dist/components/BarChart/BarChart.variants.js +81 -0
- package/dist/components/BarChart/BarChart.variants.js.map +1 -0
- package/dist/components/BarChart/index.d.ts +2 -0
- package/dist/components/BarChart/index.d.ts.map +1 -0
- package/dist/components/BarChart/index.js +2 -0
- package/dist/components/BarChart/index.js.map +1 -0
- package/dist/components/Button/Button.d.ts +6 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +5 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.variants.d.ts +6 -1
- package/dist/components/Button/Button.variants.d.ts.map +1 -1
- package/dist/components/Button/Button.variants.js +13 -1
- package/dist/components/Button/Button.variants.js.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +3 -3
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.variants.d.ts +4 -1
- package/dist/components/Card/Card.variants.d.ts.map +1 -1
- package/dist/components/Card/Card.variants.js +6 -1
- package/dist/components/Card/Card.variants.js.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +30 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.js +32 -0
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.variants.d.ts +24 -0
- package/dist/components/ColorPicker/ColorPicker.variants.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.variants.js +42 -0
- package/dist/components/ColorPicker/ColorPicker.variants.js.map +1 -0
- package/dist/components/ColorPicker/index.d.ts +2 -0
- package/dist/components/ColorPicker/index.d.ts.map +1 -0
- package/dist/components/ColorPicker/index.js +2 -0
- package/dist/components/ColorPicker/index.js.map +1 -0
- package/dist/components/FileButton/FileButton.d.ts +3 -1
- package/dist/components/FileButton/FileButton.d.ts.map +1 -1
- package/dist/components/FileButton/FileButton.js +2 -2
- package/dist/components/FileButton/FileButton.js.map +1 -1
- package/dist/components/Grid/Grid.variants.d.ts +1 -0
- package/dist/components/Grid/Grid.variants.d.ts.map +1 -1
- package/dist/components/Grid/Grid.variants.js +4 -3
- package/dist/components/Grid/Grid.variants.js.map +1 -1
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts.map +1 -1
- package/dist/components/Heading/Heading.js +2 -2
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/Heading/Heading.variants.d.ts +1 -0
- package/dist/components/Heading/Heading.variants.d.ts.map +1 -1
- package/dist/components/Heading/Heading.variants.js +2 -0
- package/dist/components/Heading/Heading.variants.js.map +1 -1
- package/dist/components/LoadingMark/LoadingMark.d.ts +11 -0
- package/dist/components/LoadingMark/LoadingMark.d.ts.map +1 -0
- package/dist/components/LoadingMark/LoadingMark.js +17 -0
- package/dist/components/LoadingMark/LoadingMark.js.map +1 -0
- package/dist/components/LoadingMark/LoadingMark.variants.d.ts +22 -0
- package/dist/components/LoadingMark/LoadingMark.variants.d.ts.map +1 -0
- package/dist/components/LoadingMark/LoadingMark.variants.js +18 -0
- package/dist/components/LoadingMark/LoadingMark.variants.js.map +1 -0
- package/dist/components/LoadingMark/index.d.ts +2 -0
- package/dist/components/LoadingMark/index.d.ts.map +1 -0
- package/dist/components/LoadingMark/index.js +2 -0
- package/dist/components/LoadingMark/index.js.map +1 -0
- package/dist/components/Logo/Logo.d.ts +10 -2
- package/dist/components/Logo/Logo.d.ts.map +1 -1
- package/dist/components/Logo/Logo.js +11 -3
- package/dist/components/Logo/Logo.js.map +1 -1
- package/dist/components/Logo/Logo.variants.d.ts +5 -2
- package/dist/components/Logo/Logo.variants.d.ts.map +1 -1
- package/dist/components/Logo/Logo.variants.js +10 -1
- package/dist/components/Logo/Logo.variants.js.map +1 -1
- package/dist/components/Meter/Meter.d.ts +13 -0
- package/dist/components/Meter/Meter.d.ts.map +1 -0
- package/dist/components/Meter/Meter.js +8 -0
- package/dist/components/Meter/Meter.js.map +1 -0
- package/dist/components/Meter/Meter.variants.d.ts +14 -0
- package/dist/components/Meter/Meter.variants.d.ts.map +1 -0
- package/dist/components/Meter/Meter.variants.js +39 -0
- package/dist/components/Meter/Meter.variants.js.map +1 -0
- package/dist/components/Meter/index.d.ts +2 -0
- package/dist/components/Meter/index.d.ts.map +1 -0
- package/dist/components/Meter/index.js +2 -0
- package/dist/components/Meter/index.js.map +1 -0
- package/dist/components/Segmented/Segmented.d.ts +14 -1
- package/dist/components/Segmented/Segmented.d.ts.map +1 -1
- package/dist/components/Segmented/Segmented.js +14 -5
- package/dist/components/Segmented/Segmented.js.map +1 -1
- package/dist/components/Segmented/Segmented.variants.d.ts +14 -1
- package/dist/components/Segmented/Segmented.variants.d.ts.map +1 -1
- package/dist/components/Segmented/Segmented.variants.js +19 -3
- package/dist/components/Segmented/Segmented.variants.js.map +1 -1
- package/dist/components/Spotlight/Spotlight.d.ts +16 -0
- package/dist/components/Spotlight/Spotlight.d.ts.map +1 -0
- package/dist/components/Spotlight/Spotlight.js +28 -0
- package/dist/components/Spotlight/Spotlight.js.map +1 -0
- package/dist/components/Spotlight/Spotlight.variants.d.ts +8 -0
- package/dist/components/Spotlight/Spotlight.variants.d.ts.map +1 -0
- package/dist/components/Spotlight/Spotlight.variants.js +15 -0
- package/dist/components/Spotlight/Spotlight.variants.js.map +1 -0
- package/dist/components/Spotlight/index.d.ts +2 -0
- package/dist/components/Spotlight/index.d.ts.map +1 -0
- package/dist/components/Spotlight/index.js +2 -0
- package/dist/components/Spotlight/index.js.map +1 -0
- package/dist/components/Table/Table.d.ts +8 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.js +4 -4
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/Table.variants.d.ts +6 -2
- package/dist/components/Table/Table.variants.d.ts.map +1 -1
- package/dist/components/Table/Table.variants.js +11 -5
- package/dist/components/Table/Table.variants.js.map +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/scales.d.ts +2 -2
- package/dist/components/scales.d.ts.map +1 -1
- package/dist/components/scales.js +4 -2
- package/dist/components/scales.js.map +1 -1
- package/dist/patterns/AppShell/AppShell.d.ts +33 -8
- package/dist/patterns/AppShell/AppShell.d.ts.map +1 -1
- package/dist/patterns/AppShell/AppShell.js +39 -7
- package/dist/patterns/AppShell/AppShell.js.map +1 -1
- package/dist/patterns/AppShell/AppShell.variants.d.ts +72 -20
- package/dist/patterns/AppShell/AppShell.variants.d.ts.map +1 -1
- package/dist/patterns/AppShell/AppShell.variants.js +118 -23
- package/dist/patterns/AppShell/AppShell.variants.js.map +1 -1
- package/dist/patterns/AppShell/index.d.ts +1 -1
- package/dist/patterns/AppShell/index.d.ts.map +1 -1
- package/dist/patterns/AppShell/index.js.map +1 -1
- package/dist/patterns/CommandPalette/CommandPalette.d.ts +36 -0
- package/dist/patterns/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.js +18 -0
- package/dist/patterns/CommandPalette/CommandPalette.js.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts +18 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.js +21 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.js.map +1 -0
- package/dist/patterns/CommandPalette/index.d.ts +2 -0
- package/dist/patterns/CommandPalette/index.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/index.js +2 -0
- package/dist/patterns/CommandPalette/index.js.map +1 -0
- package/dist/patterns/ImagePicker/ImagePicker.d.ts +9 -1
- package/dist/patterns/ImagePicker/ImagePicker.d.ts.map +1 -1
- package/dist/patterns/ImagePicker/ImagePicker.js +13 -8
- package/dist/patterns/ImagePicker/ImagePicker.js.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.d.ts +2 -0
- package/dist/patterns/OptionPicker/OptionPicker.d.ts.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.js +8 -3
- package/dist/patterns/OptionPicker/OptionPicker.js.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts +10 -4
- package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.variants.js +29 -6
- package/dist/patterns/OptionPicker/OptionPicker.variants.js.map +1 -1
- package/dist/patterns/Outline/Outline.d.ts +26 -0
- package/dist/patterns/Outline/Outline.d.ts.map +1 -0
- package/dist/patterns/Outline/Outline.js +21 -0
- package/dist/patterns/Outline/Outline.js.map +1 -0
- package/dist/patterns/Outline/Outline.variants.d.ts +11 -0
- package/dist/patterns/Outline/Outline.variants.d.ts.map +1 -0
- package/dist/patterns/Outline/Outline.variants.js +21 -0
- package/dist/patterns/Outline/Outline.variants.js.map +1 -0
- package/dist/patterns/Outline/index.d.ts +2 -0
- package/dist/patterns/Outline/index.d.ts.map +1 -0
- package/dist/patterns/Outline/index.js +2 -0
- package/dist/patterns/Outline/index.js.map +1 -0
- package/dist/patterns/PageHeader/PageHeader.d.ts +33 -4
- package/dist/patterns/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/patterns/PageHeader/PageHeader.js +31 -6
- package/dist/patterns/PageHeader/PageHeader.js.map +1 -1
- package/dist/patterns/PageHeader/PageHeader.variants.d.ts +23 -2
- package/dist/patterns/PageHeader/PageHeader.variants.d.ts.map +1 -1
- package/dist/patterns/PageHeader/PageHeader.variants.js +33 -2
- package/dist/patterns/PageHeader/PageHeader.variants.js.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.d.ts +138 -4
- package/dist/patterns/PagePreview/PagePreview.d.ts.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.js +159 -13
- package/dist/patterns/PagePreview/PagePreview.js.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.variants.d.ts +15 -2
- package/dist/patterns/PagePreview/PagePreview.variants.d.ts.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.variants.js +22 -6
- package/dist/patterns/PagePreview/PagePreview.variants.js.map +1 -1
- package/dist/patterns/PagePreview/index.d.ts +1 -1
- package/dist/patterns/PagePreview/index.d.ts.map +1 -1
- package/dist/patterns/PagePreview/index.js.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.d.ts +20 -4
- package/dist/patterns/SaveBar/SaveBar.d.ts.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.js +22 -4
- package/dist/patterns/SaveBar/SaveBar.js.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.variants.d.ts +27 -5
- package/dist/patterns/SaveBar/SaveBar.variants.d.ts.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.variants.js +39 -6
- package/dist/patterns/SaveBar/SaveBar.variants.js.map +1 -1
- package/dist/patterns/SectionList/SectionList.d.ts.map +1 -1
- package/dist/patterns/SectionList/SectionList.js +2 -2
- package/dist/patterns/SectionList/SectionList.js.map +1 -1
- package/dist/patterns/SectionList/SectionList.variants.d.ts +4 -1
- package/dist/patterns/SectionList/SectionList.variants.d.ts.map +1 -1
- package/dist/patterns/SectionList/SectionList.variants.js +5 -2
- package/dist/patterns/SectionList/SectionList.variants.js.map +1 -1
- package/dist/patterns/SiteWindow/SiteWindow.d.ts +20 -0
- package/dist/patterns/SiteWindow/SiteWindow.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.js +8 -0
- package/dist/patterns/SiteWindow/SiteWindow.js.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts +24 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.js +25 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.js.map +1 -0
- package/dist/patterns/SiteWindow/index.d.ts +2 -0
- package/dist/patterns/SiteWindow/index.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/index.js +2 -0
- package/dist/patterns/SiteWindow/index.js.map +1 -0
- package/dist/patterns/Split/Split.variants.d.ts +2 -2
- package/dist/patterns/Split/Split.variants.d.ts.map +1 -1
- package/dist/patterns/Split/Split.variants.js +2 -2
- package/dist/patterns/Split/Split.variants.js.map +1 -1
- package/dist/patterns/Welcome/Welcome.d.ts +18 -0
- package/dist/patterns/Welcome/Welcome.d.ts.map +1 -0
- package/dist/patterns/Welcome/Welcome.js +20 -0
- package/dist/patterns/Welcome/Welcome.js.map +1 -0
- package/dist/patterns/Welcome/Welcome.variants.d.ts +12 -0
- package/dist/patterns/Welcome/Welcome.variants.d.ts.map +1 -0
- package/dist/patterns/Welcome/Welcome.variants.js +12 -0
- package/dist/patterns/Welcome/Welcome.variants.js.map +1 -0
- package/dist/patterns/Welcome/index.d.ts +2 -0
- package/dist/patterns/Welcome/index.d.ts.map +1 -0
- package/dist/patterns/Welcome/index.js +2 -0
- package/dist/patterns/Welcome/index.js.map +1 -0
- package/dist/patterns/Workbench/Workbench.d.ts +35 -4
- package/dist/patterns/Workbench/Workbench.d.ts.map +1 -1
- package/dist/patterns/Workbench/Workbench.js +59 -4
- package/dist/patterns/Workbench/Workbench.js.map +1 -1
- package/dist/patterns/Workbench/Workbench.variants.d.ts +56 -4
- package/dist/patterns/Workbench/Workbench.variants.d.ts.map +1 -1
- package/dist/patterns/Workbench/Workbench.variants.js +111 -4
- package/dist/patterns/Workbench/Workbench.variants.js.map +1 -1
- package/dist/patterns/Workbench/index.d.ts +1 -1
- package/dist/patterns/Workbench/index.d.ts.map +1 -1
- package/dist/patterns/Workbench/index.js.map +1 -1
- package/dist/patterns/index.d.ts +4 -0
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +4 -0
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/page-bar.d.ts +17 -0
- package/dist/patterns/page-bar.d.ts.map +1 -0
- package/dist/patterns/page-bar.js +22 -0
- package/dist/patterns/page-bar.js.map +1 -0
- package/package.json +2 -1
- package/src/styles.css +136 -0
- package/src/tokens/tokens.css +26 -1
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* On its own, the top of a screen, with the actions under the title when there is no room beside it.
|
|
4
|
+
* In the shell's bar, one row on every window: the title and its sentence on the left, the actions on the right.
|
|
5
|
+
*/
|
|
6
|
+
export const pageHeaderVariants = cva('flex min-w-0 justify-between', {
|
|
7
|
+
variants: {
|
|
8
|
+
place: {
|
|
9
|
+
page: 'flex-wrap items-start gap-x-6 gap-y-4',
|
|
10
|
+
bar: 'flex-1 items-center gap-2 md:gap-4 md:py-2',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: { place: 'page' },
|
|
14
|
+
});
|
|
15
|
+
/** In the bar, one row: the title, then its sentence after it, cut to fit. */
|
|
16
|
+
export const pageHeaderTitleVariants = cva('flex min-w-0', {
|
|
17
|
+
variants: { place: { page: 'flex-col gap-1', bar: 'flex-1 items-baseline gap-3' } },
|
|
18
|
+
defaultVariants: { place: 'page' },
|
|
19
|
+
});
|
|
20
|
+
/** In the bar a phone has room for the title alone: the sentence after it comes from `md` up. */
|
|
21
|
+
export const pageHeaderDescriptionVariants = cva('min-w-0', {
|
|
22
|
+
variants: { place: { page: '', bar: 'hidden flex-1 md:block' } },
|
|
23
|
+
defaultVariants: { place: 'page' },
|
|
24
|
+
});
|
|
25
|
+
/** In the bar they never wrap: on a phone they are icons and one menu. */
|
|
26
|
+
export const pageHeaderActionsVariants = cva('flex max-w-full shrink-0 items-center', {
|
|
27
|
+
variants: { place: { page: 'flex-wrap gap-2', bar: 'gap-1 md:gap-2' } },
|
|
28
|
+
defaultVariants: { place: 'page' },
|
|
29
|
+
});
|
|
30
|
+
/** The other buttons, as buttons from `md` up. */
|
|
31
|
+
export const pageHeaderSecondaryClass = 'hidden items-center gap-2 md:flex';
|
|
32
|
+
/** The same, as one menu on a phone. */
|
|
33
|
+
export const pageHeaderMoreClass = 'flex md:hidden';
|
|
3
34
|
//# sourceMappingURL=PageHeader.variants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.variants.js","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"PageHeader.variants.js","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC,8BAA8B,EAAE;IACpE,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,uCAAuC;YAC7C,GAAG,EAAE,4CAA4C;SAClD;KACF;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC,cAAc,EAAE;IACzD,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,6BAA6B,EAAE,EAAE;IACnF,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,iGAAiG;AACjG,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC,SAAS,EAAE;IAC1D,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,wBAAwB,EAAE,EAAE;IAChE,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC,uCAAuC,EAAE;IACpF,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE;IACvE,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,kDAAkD;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAG,mCAAmC,CAAC;AAC5E,wCAAwC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type PagePreviewVariants } from './PagePreview.variants.js';
|
|
3
|
+
/** What can be done to a section from the page itself. */
|
|
4
|
+
declare const ACTIONS: readonly ["up", "down", "duplicate", "remove", "addBefore", "addAfter"];
|
|
5
|
+
export type PageSectionAction = (typeof ACTIONS)[number];
|
|
6
|
+
declare const ITEM_ACTIONS: readonly ["up", "down", "duplicate", "remove"];
|
|
7
|
+
/** What can be done to one item of a list from the page. */
|
|
8
|
+
export type PageItemAction = (typeof ITEM_ACTIONS)[number];
|
|
9
|
+
/** A look of a section chosen among a few of the site's colours: its field, what it is called, each choice with a sample, and the one chosen. */
|
|
10
|
+
export interface PageSectionSwatches {
|
|
11
|
+
readonly field: string;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly chosen?: string;
|
|
14
|
+
readonly choices: readonly {
|
|
15
|
+
readonly value: string;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly colour: string;
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
export interface PageSectionTools {
|
|
21
|
+
/** What each button is called, shown when the pointer rests on it, and the words on the button that adds a section. */
|
|
22
|
+
readonly labels: {
|
|
23
|
+
readonly up: string;
|
|
24
|
+
readonly down: string;
|
|
25
|
+
readonly duplicate: string;
|
|
26
|
+
readonly remove: string;
|
|
27
|
+
readonly add: string;
|
|
28
|
+
readonly addBefore: string;
|
|
29
|
+
readonly addAfter: string;
|
|
30
|
+
readonly picture?: string;
|
|
31
|
+
readonly link?: string;
|
|
32
|
+
readonly bold?: string;
|
|
33
|
+
readonly italic?: string;
|
|
34
|
+
readonly textLink?: string;
|
|
35
|
+
readonly itemUp?: string;
|
|
36
|
+
readonly itemDown?: string;
|
|
37
|
+
readonly itemDuplicate?: string;
|
|
38
|
+
readonly itemRemove?: string;
|
|
39
|
+
};
|
|
40
|
+
/** For each section's id: what it is called, and what can be done to it now. */
|
|
41
|
+
readonly sections: Readonly<Record<string, {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly up: boolean;
|
|
44
|
+
readonly down: boolean;
|
|
45
|
+
readonly copy: boolean;
|
|
46
|
+
readonly add: boolean;
|
|
47
|
+
readonly pictures?: readonly string[];
|
|
48
|
+
readonly links?: readonly string[];
|
|
49
|
+
readonly lists?: readonly {
|
|
50
|
+
readonly field: string;
|
|
51
|
+
readonly count: number;
|
|
52
|
+
readonly full: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
readonly swatches?: readonly PageSectionSwatches[];
|
|
55
|
+
readonly list?: string;
|
|
56
|
+
readonly group?: string;
|
|
57
|
+
}>>;
|
|
58
|
+
/**
|
|
59
|
+
* The places inside sections that hold sections of their own, each by the section it is in and its field (`id:columns.0.content`):
|
|
60
|
+
* which places take each other's sections (`group`), and whether one is empty or takes no more.
|
|
61
|
+
*/
|
|
62
|
+
readonly slots?: Readonly<Record<string, {
|
|
63
|
+
readonly group: string;
|
|
64
|
+
readonly empty: boolean;
|
|
65
|
+
readonly full: boolean;
|
|
66
|
+
}>>;
|
|
67
|
+
}
|
|
3
68
|
export interface PagePreviewProps extends PagePreviewVariants {
|
|
4
69
|
/** Names the frame for screen readers: "Why list with us, as it would look". */
|
|
5
70
|
readonly label: string;
|
|
@@ -14,16 +79,85 @@ export interface PagePreviewProps extends PagePreviewVariants {
|
|
|
14
79
|
readonly note?: string;
|
|
15
80
|
/** Controls for the preview, such as the choice of width. */
|
|
16
81
|
readonly toolbar?: ReactNode;
|
|
82
|
+
/** The one thing to do with the page, such as opening it larger: a `Button` at the start of the bar, in place of `note`. */
|
|
83
|
+
readonly action?: ReactNode;
|
|
17
84
|
/** Shown in place of the page when there is no `address`. */
|
|
18
85
|
readonly emptyText: string;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Called with a section's id when it is pressed on the page, and with the field that was
|
|
88
|
+
* pressed, as keys (`title`, `items.0.text`), where the page marks its fields.
|
|
89
|
+
*/
|
|
90
|
+
readonly onSectionPress?: (id: string, field?: string, inForm?: boolean) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Called when the page asks where a link in text being written there should lead, with the
|
|
93
|
+
* address it has now (or none) and how to answer: an address, nothing to take the link away,
|
|
94
|
+
* or `null` to leave it as it is. Ask the person, then answer.
|
|
95
|
+
*/
|
|
96
|
+
readonly onTextLink?: (href: string, answer: (href: string | null) => void) => void;
|
|
97
|
+
/** Called when a swatch on a section's bar is pressed: the section, the field and the choice. Whoever holds the sections makes the change. */
|
|
98
|
+
readonly onSectionSwatch?: (id: string, field: string, value: string) => void;
|
|
99
|
+
/** Called when the keys that take a change back are pressed on the page. The page takes nothing back itself. */
|
|
100
|
+
readonly onUndo?: () => void;
|
|
101
|
+
/** Called when the keys that make a change again are pressed on the page. */
|
|
102
|
+
readonly onRedo?: () => void;
|
|
103
|
+
/** Called when the keys that save are pressed on the page. The page saves nothing itself. */
|
|
104
|
+
readonly onSave?: () => void;
|
|
105
|
+
/**
|
|
106
|
+
* How many times Escape was pressed in the editor around the page. Each new count is told to the page as
|
|
107
|
+
* its own Escape: it drops a dragged section where it was and closes its list of sections, as Escape on
|
|
108
|
+
* the page does, wherever the keyboard happened to be.
|
|
109
|
+
*/
|
|
110
|
+
readonly escapes?: number;
|
|
111
|
+
/** The section the page should have in view, and outlined. */
|
|
22
112
|
readonly shownSectionId?: string;
|
|
113
|
+
/** Changes each time the section is asked for again, so the same one is brought into view again. */
|
|
114
|
+
readonly shownAt?: number;
|
|
115
|
+
/**
|
|
116
|
+
* Where words may be typed on the page itself: for each section's id, the fields of it, as keys
|
|
117
|
+
* (`title`, `items.0.text`). Left out, the page is only looked at and pressed.
|
|
118
|
+
*/
|
|
119
|
+
readonly typable?: Readonly<Record<string, readonly string[]>>;
|
|
120
|
+
/**
|
|
121
|
+
* Called as words are typed into a field on the page, with all the field now says. The page
|
|
122
|
+
* already shows them, so the change of `draft` that follows asks for no new page.
|
|
123
|
+
*/
|
|
124
|
+
readonly onWords?: (id: string, field: string, words: string) => void;
|
|
125
|
+
/**
|
|
126
|
+
* Puts a small bar on the section the pointer is in (move up, move down, copy, remove) and a
|
|
127
|
+
* button at each of its edges that adds a section there. Left out, the page has none.
|
|
128
|
+
*/
|
|
129
|
+
readonly tools?: PageSectionTools;
|
|
130
|
+
/** Called when a button of `tools` is pressed on the page. The page changes nothing itself. */
|
|
131
|
+
readonly onSectionAction?: (id: string, action: PageSectionAction) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Called when a section is dragged by its bar and let go: with the section it should now come
|
|
134
|
+
* before, or `null` for after the last.
|
|
135
|
+
*/
|
|
136
|
+
readonly onSectionMove?: (id: string, beforeId: string | null, into?: string) => void;
|
|
137
|
+
/** Called when the button of an empty place inside a section is pressed on the page: the section and the place's field, as keys. Offer what can be added there. */
|
|
138
|
+
readonly onSectionSlot?: (id: string, field: string) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Called when the button on one of a section's pictures is pressed on the page, with the
|
|
141
|
+
* section's id and the picture's field, as keys. Open the window the picture is chosen in.
|
|
142
|
+
*/
|
|
143
|
+
readonly onSectionPicture?: (id: string, field: string) => void;
|
|
144
|
+
/**
|
|
145
|
+
* Called when the button on one of a section's links is pressed on the page, with the section's
|
|
146
|
+
* id and the link's field, as keys. Open a window the link is changed in.
|
|
147
|
+
*/
|
|
148
|
+
readonly onSectionLink?: (id: string, field: string) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Called when a button on one item of a section's list is pressed on the page, with the section's
|
|
151
|
+
* id, the list's field as keys, the item's place and what was asked. Whoever holds the list makes the change.
|
|
152
|
+
*/
|
|
153
|
+
readonly onSectionItem?: (id: string, field: string, at: number, action: PageItemAction) => void;
|
|
154
|
+
/** No border of its own, for a place that frames it already, such as a whole window. */
|
|
155
|
+
readonly isBare?: boolean;
|
|
23
156
|
}
|
|
24
157
|
/**
|
|
25
158
|
* A page of the site as it would look with what is in a form now, in a frame. The page is drawn
|
|
26
159
|
* by the site itself, so it looks exactly as it will; nothing of it is drawn here.
|
|
27
160
|
*/
|
|
28
|
-
export declare function PagePreview({ label, address, draft, note, toolbar, emptyText, onSectionPress, shownSectionId, width }: PagePreviewProps): import("react").JSX.Element;
|
|
161
|
+
export declare function PagePreview({ label, address, draft, note, toolbar, action, emptyText, onSectionPress, shownSectionId, shownAt, typable, onWords, tools, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave, escapes, isBare, width }: PagePreviewProps): import("react").JSX.Element;
|
|
162
|
+
export {};
|
|
29
163
|
//# sourceMappingURL=PagePreview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PagePreview.d.ts","sourceRoot":"","sources":["../../../src/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,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACjG,wFAAwF;IACxF,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,OAAW,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAW,EAAE,MAAc,EAAE,KAAK,EAAE,EAAE,gBAAgB,+BA2MtW"}
|
|
@@ -1,42 +1,119 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useRef } from 'react';
|
|
2
|
+
import { useEffect, useId, useRef, useState } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import { pagePreviewBarClass,
|
|
4
|
+
import { pagePreviewBarClass, pagePreviewVariants, pagePreviewEmptyClass, pagePreviewFrameVariants, pagePreviewNoteClass, pagePreviewStageVariants, pagePreviewWidths, } from './PagePreview.variants.js';
|
|
5
5
|
/** How long the page waits after the last change before it is drawn again, in milliseconds. */
|
|
6
6
|
const PAUSE = 500;
|
|
7
7
|
/** The name both sides put on what they say to each other, so nothing else is taken for it. */
|
|
8
8
|
const SOURCE = 'velocity-cms';
|
|
9
|
+
/** How long after words were typed on the page a change of the draft is taken to be those words, in milliseconds. */
|
|
10
|
+
const OWN = 250;
|
|
11
|
+
/** How close a change of the draft and a section asked for must be to be one act, such as a section moved, in milliseconds. */
|
|
12
|
+
const TOGETHER = 100;
|
|
13
|
+
/** How much of a screen's width a pane must have for the page to be shown at the pane's own width. */
|
|
14
|
+
const NEARLY = 0.9;
|
|
15
|
+
/** What can be done to a section from the page itself. */
|
|
16
|
+
const ACTIONS = ['up', 'down', 'duplicate', 'remove', 'addBefore', 'addAfter'];
|
|
17
|
+
const ITEM_ACTIONS = ['up', 'down', 'duplicate', 'remove'];
|
|
9
18
|
/**
|
|
10
19
|
* A page of the site as it would look with what is in a form now, in a frame. The page is drawn
|
|
11
20
|
* by the site itself, so it looks exactly as it will; nothing of it is drawn here.
|
|
12
21
|
*/
|
|
13
|
-
export function PagePreview({ label, address, draft, note, toolbar, emptyText, onSectionPress, shownSectionId, width }) {
|
|
22
|
+
export function PagePreview({ label, address, draft, note, toolbar, action, emptyText, onSectionPress, shownSectionId, shownAt = 0, typable, onWords, tools, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave, escapes = 0, isBare = false, width }) {
|
|
14
23
|
const name = `preview-${useId().replaceAll(':', '')}`;
|
|
15
24
|
const form = useRef(null);
|
|
16
25
|
const frame = useRef(null);
|
|
17
26
|
const hasSent = useRef(false);
|
|
18
|
-
const
|
|
27
|
+
const places = typable === undefined ? undefined : JSON.stringify(typable);
|
|
28
|
+
const offered = tools === undefined ? undefined : JSON.stringify(tools);
|
|
29
|
+
const latest = useRef({ onSectionPress, shownSectionId, onWords, places, offered, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave });
|
|
19
30
|
useEffect(() => {
|
|
20
|
-
latest.current = { onSectionPress, shownSectionId };
|
|
31
|
+
latest.current = { onSectionPress, shownSectionId, onWords, places, offered, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave };
|
|
21
32
|
});
|
|
33
|
+
// When words were last typed on the page, and whether the page lacks a change made in the form.
|
|
34
|
+
const typedAt = useRef(0);
|
|
35
|
+
// When a button of the page's own tools was last pressed there.
|
|
36
|
+
const pressedAt = useRef(0);
|
|
37
|
+
const isBehind = useRef(false);
|
|
38
|
+
// When a section was last asked to be shown, and when the draft last changed. A page drawn again
|
|
39
|
+
// stays where the person left it, unless the change itself asked for a section: one just moved or added.
|
|
40
|
+
const askedAt = useRef(0);
|
|
41
|
+
const changedAt = useRef(0);
|
|
42
|
+
const hasDrawn = useRef(false);
|
|
22
43
|
// The first page is asked for at once. After that, a pause in the typing asks for the next.
|
|
23
44
|
useEffect(() => {
|
|
45
|
+
changedAt.current = Date.now();
|
|
24
46
|
if (address === undefined)
|
|
25
47
|
return;
|
|
26
48
|
const send = () => {
|
|
27
49
|
hasSent.current = true;
|
|
50
|
+
isBehind.current = false;
|
|
28
51
|
form.current?.submit();
|
|
29
52
|
};
|
|
30
53
|
if (!hasSent.current) {
|
|
31
54
|
send();
|
|
32
55
|
return;
|
|
33
56
|
}
|
|
57
|
+
// Words typed on the page are on the page already: drawing it again would take the caret away.
|
|
58
|
+
if (Date.now() - typedAt.current < OWN && !isBehind.current)
|
|
59
|
+
return;
|
|
60
|
+
isBehind.current = true;
|
|
61
|
+
// A button pressed on the page is one change, made: there is no typing to wait out.
|
|
62
|
+
if (Date.now() - pressedAt.current < TOGETHER * 5) {
|
|
63
|
+
pressedAt.current = 0;
|
|
64
|
+
send();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
34
67
|
const waiting = setTimeout(send, PAUSE);
|
|
35
68
|
return () => clearTimeout(waiting);
|
|
36
69
|
}, [address, draft]);
|
|
37
|
-
|
|
70
|
+
// The page is drawn at the width of the screen it is tried on, whatever room the pane has: one
|
|
71
|
+
// wider than the pane is shown smaller, whole, never as the narrower layout that would fit.
|
|
72
|
+
const stage = useRef(null);
|
|
73
|
+
const [room, setRoom] = useState(null);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const element = stage.current;
|
|
76
|
+
if (!element || typeof ResizeObserver === 'undefined')
|
|
77
|
+
return;
|
|
78
|
+
const measure = () => setRoom({ width: element.clientWidth, height: element.clientHeight });
|
|
79
|
+
const watching = new ResizeObserver(measure);
|
|
80
|
+
watching.observe(element);
|
|
81
|
+
measure();
|
|
82
|
+
return () => watching.disconnect();
|
|
83
|
+
}, [address === undefined]);
|
|
84
|
+
const wanted = pagePreviewWidths[width ?? 'full'];
|
|
85
|
+
// A pane nearly as wide shows the page at its own width instead: a little narrower reads better than a little smaller.
|
|
86
|
+
const fits = room === null || room.width <= 0 || room.width >= wanted * NEARLY;
|
|
87
|
+
const scale = fits ? 1 : room.width / wanted;
|
|
88
|
+
const isFitted = scale < 1;
|
|
89
|
+
// A page takes itself to be shown at its own size, so it is told only when that is not so, or no longer so.
|
|
90
|
+
const told = useRef(1);
|
|
91
|
+
const zoom = (to) => {
|
|
92
|
+
if (to === told.current)
|
|
93
|
+
return;
|
|
94
|
+
told.current = to;
|
|
95
|
+
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'zoom', scale: to }, window.location.origin);
|
|
96
|
+
};
|
|
97
|
+
const scaleNow = useRef(scale);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
scaleNow.current = scale;
|
|
100
|
+
zoom(scale);
|
|
101
|
+
}, [scale]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (escapes > 0)
|
|
104
|
+
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'escape' }, window.location.origin);
|
|
105
|
+
}, [escapes]);
|
|
106
|
+
const show = (id, still = false) => {
|
|
38
107
|
if (id !== undefined)
|
|
39
|
-
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'show', id }, window.location.origin);
|
|
108
|
+
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'show', id, ...(still && { still }) }, window.location.origin);
|
|
109
|
+
};
|
|
110
|
+
const tell = (said) => {
|
|
111
|
+
if (said !== undefined)
|
|
112
|
+
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'typable', places: JSON.parse(said) }, window.location.origin);
|
|
113
|
+
};
|
|
114
|
+
const offer = (said) => {
|
|
115
|
+
if (said !== undefined)
|
|
116
|
+
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'tools', ...JSON.parse(said) }, window.location.origin);
|
|
40
117
|
};
|
|
41
118
|
// Only this site's own page, in this frame, is listened to.
|
|
42
119
|
useEffect(() => {
|
|
@@ -46,15 +123,84 @@ export function PagePreview({ label, address, draft, note, toolbar, emptyText, o
|
|
|
46
123
|
const said = event.data;
|
|
47
124
|
if (said?.source !== SOURCE)
|
|
48
125
|
return;
|
|
49
|
-
if (said.type === 'section' && typeof said.id === 'string')
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
126
|
+
if (said.type === 'section' && typeof said.id === 'string') {
|
|
127
|
+
if (typeof said.field === 'string')
|
|
128
|
+
latest.current.onSectionPress?.(said.id, said.field, said.form === true);
|
|
129
|
+
else
|
|
130
|
+
latest.current.onSectionPress?.(said.id);
|
|
131
|
+
}
|
|
132
|
+
if (said.type === 'words' && typeof said.id === 'string' && typeof said.field === 'string' && typeof said.words === 'string') {
|
|
133
|
+
typedAt.current = Date.now();
|
|
134
|
+
latest.current.onWords?.(said.id, said.field, said.words);
|
|
135
|
+
}
|
|
136
|
+
if (said.type === 'act' || said.type === 'move' || said.type === 'item' || said.type === 'swatch' || said.type === 'undo' || said.type === 'redo')
|
|
137
|
+
pressedAt.current = Date.now();
|
|
138
|
+
if (said.type === 'act' && typeof said.id === 'string') {
|
|
139
|
+
const action = ACTIONS.find((candidate) => candidate === said.action);
|
|
140
|
+
if (action)
|
|
141
|
+
latest.current.onSectionAction?.(said.id, action);
|
|
142
|
+
}
|
|
143
|
+
if (said.type === 'move' && typeof said.id === 'string' && (typeof said.before === 'string' || said.before === null)) {
|
|
144
|
+
if (typeof said.into === 'string')
|
|
145
|
+
latest.current.onSectionMove?.(said.id, said.before, said.into);
|
|
146
|
+
else
|
|
147
|
+
latest.current.onSectionMove?.(said.id, said.before);
|
|
148
|
+
}
|
|
149
|
+
if (said.type === 'slot' && typeof said.id === 'string' && typeof said.field === 'string') {
|
|
150
|
+
latest.current.onSectionSlot?.(said.id, said.field);
|
|
151
|
+
}
|
|
152
|
+
if (said.type === 'picture' && typeof said.id === 'string' && typeof said.field === 'string') {
|
|
153
|
+
latest.current.onSectionPicture?.(said.id, said.field);
|
|
154
|
+
}
|
|
155
|
+
if (said.type === 'link' && typeof said.id === 'string' && typeof said.field === 'string') {
|
|
156
|
+
latest.current.onSectionLink?.(said.id, said.field);
|
|
157
|
+
}
|
|
158
|
+
if (said.type === 'item' && typeof said.id === 'string' && typeof said.field === 'string' && typeof said.at === 'number') {
|
|
159
|
+
const action = ITEM_ACTIONS.find((candidate) => candidate === said.action);
|
|
160
|
+
if (action)
|
|
161
|
+
latest.current.onSectionItem?.(said.id, said.field, said.at, action);
|
|
162
|
+
}
|
|
163
|
+
if (said.type === 'swatch' && typeof said.id === 'string' && typeof said.field === 'string' && typeof said.value === 'string') {
|
|
164
|
+
latest.current.onSectionSwatch?.(said.id, said.field, said.value);
|
|
165
|
+
}
|
|
166
|
+
if (said.type === 'linkAsk' && typeof said.href === 'string') {
|
|
167
|
+
const page = frame.current?.contentWindow;
|
|
168
|
+
const answer = (href) => page?.postMessage({ source: SOURCE, type: 'linkAnswer', href }, window.location.origin);
|
|
169
|
+
if (latest.current.onTextLink)
|
|
170
|
+
latest.current.onTextLink(said.href, answer);
|
|
171
|
+
else
|
|
172
|
+
answer(null);
|
|
173
|
+
}
|
|
174
|
+
if (said.type === 'undo' || said.type === 'redo') {
|
|
175
|
+
// What the form holds next is not what the page shows, however lately words were typed there.
|
|
176
|
+
typedAt.current = 0;
|
|
177
|
+
if (said.type === 'undo')
|
|
178
|
+
latest.current.onUndo?.();
|
|
179
|
+
else
|
|
180
|
+
latest.current.onRedo?.();
|
|
181
|
+
}
|
|
182
|
+
if (said.type === 'save')
|
|
183
|
+
latest.current.onSave?.();
|
|
184
|
+
if (said.type === 'ready') {
|
|
185
|
+
told.current = 1;
|
|
186
|
+
zoom(scaleNow.current);
|
|
187
|
+
tell(latest.current.places);
|
|
188
|
+
offer(latest.current.offered);
|
|
189
|
+
// Outlined again, and brought into view only on the first page or when the change that drew this one asked for it.
|
|
190
|
+
show(latest.current.shownSectionId, hasDrawn.current && Math.abs(askedAt.current - changedAt.current) > TOGETHER);
|
|
191
|
+
hasDrawn.current = true;
|
|
192
|
+
askedAt.current = 0;
|
|
193
|
+
}
|
|
53
194
|
};
|
|
54
195
|
window.addEventListener('message', hear);
|
|
55
196
|
return () => window.removeEventListener('message', hear);
|
|
56
197
|
}, []);
|
|
57
|
-
useEffect(() =>
|
|
58
|
-
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
askedAt.current = Date.now();
|
|
200
|
+
show(shownSectionId);
|
|
201
|
+
}, [shownSectionId, shownAt]);
|
|
202
|
+
useEffect(() => tell(places), [places]);
|
|
203
|
+
useEffect(() => offer(offered), [offered]);
|
|
204
|
+
return (_jsxs("div", { className: pagePreviewVariants({ isBare }), children: [(note !== undefined || toolbar !== undefined || action !== undefined) && (_jsxs("div", { className: pagePreviewBarClass, children: [action ?? _jsx("span", { className: pagePreviewNoteClass, children: note }), toolbar] })), _jsx("div", { ref: stage, className: pagePreviewStageVariants({ isFitted }), children: address === undefined ? (_jsx("p", { className: pagePreviewEmptyClass, children: emptyText })) : (_jsxs(_Fragment, { children: [createPortal(_jsx("form", { ref: form, method: "post", action: address, target: name, hidden: true, children: _jsx("input", { type: "hidden", name: "draft", value: draft, readOnly: true }) }), document.body), _jsx("iframe", { ref: frame, name: name, title: label, className: pagePreviewFrameVariants({ width, isFitted }), ...(isFitted && room !== null && { style: { width: `${wanted}px`, height: `${room.height / scale}px`, transform: `scale(${scale})` } }) })] })) })] }));
|
|
59
205
|
}
|
|
60
206
|
//# sourceMappingURL=PagePreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,2BAA2B,CAAC;AAEnC,+FAA+F;AAC/F,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,+FAA+F;AAC/F,MAAM,MAAM,GAAG,cAAc,CAAC;AA8B9B;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,EAAoB;IACtI,MAAM,IAAI,GAAG,WAAW,KAAK,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC;IACtD,MAAM,IAAI,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;IAC1D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,OAAO,GAAG,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,4FAA4F;IAC5F,SAAS,CAAC,GAAG,EAAE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AG,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,SAAS,EAAE,SAAS,KAAK,GAAG,EAAE,EAAE,CAAC,GACxI,IACD,CACJ,GACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
-
|
|
2
|
+
/** In a card of its own, or bare where what holds it is the frame already. */
|
|
3
|
+
export declare const pagePreviewVariants: (props?: ({
|
|
4
|
+
isBare?: boolean | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
3
6
|
export declare const pagePreviewBarClass = "flex flex-wrap items-center justify-between gap-3 border-b border-border bg-background px-3 py-2";
|
|
4
7
|
export declare const pagePreviewNoteClass = "min-w-0 truncate text-sm text-foreground-muted";
|
|
5
|
-
|
|
8
|
+
/** A page shown smaller than it is starts at the pane's corner, and what it leaves over is cut off. */
|
|
9
|
+
export declare const pagePreviewStageVariants: (props?: ({
|
|
10
|
+
isFitted?: boolean | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
/** The width, in pixels, of the screen each choice stands for. A pane narrower than that shows the page smaller. */
|
|
13
|
+
export declare const pagePreviewWidths: {
|
|
14
|
+
readonly phone: 384;
|
|
15
|
+
readonly tablet: 768;
|
|
16
|
+
readonly full: 1280;
|
|
17
|
+
};
|
|
6
18
|
export declare const pagePreviewEmptyClass = "m-auto max-w-sm px-6 text-center text-sm text-foreground-muted";
|
|
7
19
|
/** The page at the width of the screen it is tried on. Narrower than the pane, it stands in the middle with an edge each side. */
|
|
8
20
|
export declare const pagePreviewFrameVariants: (props?: ({
|
|
9
21
|
width?: "full" | "phone" | "tablet" | null | undefined;
|
|
22
|
+
isFitted?: boolean | null | undefined;
|
|
10
23
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
24
|
export type PagePreviewVariants = VariantProps<typeof pagePreviewFrameVariants>;
|
|
12
25
|
//# sourceMappingURL=PagePreview.variants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"PagePreview.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB;;8EAG9B,CAAC;AACH,eAAO,MAAM,mBAAmB,qGAAqG,CAAC;AACtI,eAAO,MAAM,oBAAoB,mDAAmD,CAAC;AACrF,uGAAuG;AACvG,eAAO,MAAM,wBAAwB;;8EAGnC,CAAC;AAEH,oHAAoH;AACpH,eAAO,MAAM,iBAAiB;;;;CAAmD,CAAC;AAClF,eAAO,MAAM,qBAAqB,mEAAmE,CAAC;AAEtG,kIAAkI;AAClI,eAAO,MAAM,wBAAwB;;;8EAenC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
|
-
|
|
2
|
+
/** In a card of its own, or bare where what holds it is the frame already. */
|
|
3
|
+
export const pagePreviewVariants = cva('flex h-full min-h-0 flex-col overflow-hidden bg-background-secondary', {
|
|
4
|
+
variants: { isBare: { true: '', false: 'rounded-lg border border-border' } },
|
|
5
|
+
defaultVariants: { isBare: false },
|
|
6
|
+
});
|
|
3
7
|
export const pagePreviewBarClass = 'flex flex-wrap items-center justify-between gap-3 border-b border-border bg-background px-3 py-2';
|
|
4
8
|
export const pagePreviewNoteClass = 'min-w-0 truncate text-sm text-foreground-muted';
|
|
5
|
-
|
|
9
|
+
/** A page shown smaller than it is starts at the pane's corner, and what it leaves over is cut off. */
|
|
10
|
+
export const pagePreviewStageVariants = cva('flex min-h-0 flex-1', {
|
|
11
|
+
variants: { isFitted: { true: 'justify-start overflow-hidden', false: 'justify-center' } },
|
|
12
|
+
defaultVariants: { isFitted: false },
|
|
13
|
+
});
|
|
14
|
+
/** The width, in pixels, of the screen each choice stands for. A pane narrower than that shows the page smaller. */
|
|
15
|
+
export const pagePreviewWidths = { phone: 384, tablet: 768, full: 1280 };
|
|
6
16
|
export const pagePreviewEmptyClass = 'm-auto max-w-sm px-6 text-center text-sm text-foreground-muted';
|
|
7
17
|
/** The page at the width of the screen it is tried on. Narrower than the pane, it stands in the middle with an edge each side. */
|
|
8
|
-
export const pagePreviewFrameVariants = cva('
|
|
18
|
+
export const pagePreviewFrameVariants = cva('bg-background', {
|
|
9
19
|
variants: {
|
|
10
20
|
width: {
|
|
11
|
-
phone: '
|
|
12
|
-
tablet: '
|
|
21
|
+
phone: 'border-x border-border',
|
|
22
|
+
tablet: 'border-x border-border',
|
|
13
23
|
full: '',
|
|
14
24
|
},
|
|
25
|
+
// Fitted, its size is the screen's own and it is shown smaller from its corner.
|
|
26
|
+
isFitted: { true: 'max-w-none shrink-0 origin-top-left', false: 'h-full w-full transition-all motion-base' },
|
|
15
27
|
},
|
|
16
|
-
|
|
28
|
+
compoundVariants: [
|
|
29
|
+
{ width: 'phone', isFitted: false, class: 'max-w-sm' },
|
|
30
|
+
{ width: 'tablet', isFitted: false, class: 'max-w-3xl' },
|
|
31
|
+
],
|
|
32
|
+
defaultVariants: { width: 'full', isFitted: false },
|
|
17
33
|
});
|
|
18
34
|
//# sourceMappingURL=PagePreview.variants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.variants.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,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AE,IAAI,EAAE,qCAAqC,EAAE,KAAK,EAAE,0CAA0C,EAAE;KAC7G;IACD,gBAAgB,EAAE;QAChB,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;QACtD,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE;KACzD;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;CACpD,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { PagePreview, type PagePreviewProps } from './PagePreview.js';
|
|
1
|
+
export { PagePreview, type PageItemAction, type PagePreviewProps, type PageSectionAction, type PageSectionSwatches, type PageSectionTools } from './PagePreview.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuH,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
export interface SaveBarBack {
|
|
3
|
-
|
|
3
|
+
/** Where it goes. Left out, `onPress` says what going back does. */
|
|
4
|
+
readonly href?: string;
|
|
5
|
+
/** What going back does, where it is not another address: closing a view that took the window. */
|
|
6
|
+
readonly onPress?: () => void;
|
|
4
7
|
/** Where it goes, such as "Listings". */
|
|
5
8
|
readonly label: string;
|
|
6
9
|
}
|
|
@@ -11,11 +14,24 @@ export interface SaveBarProps {
|
|
|
11
14
|
readonly back?: SaveBarBack;
|
|
12
15
|
/** What is being edited. It becomes the page's level 1 heading. */
|
|
13
16
|
readonly title?: string;
|
|
14
|
-
/** Where the entry stands
|
|
17
|
+
/** Where the entry stands, such as a `Tag` saying Draft. Beside the title, on its one row. */
|
|
15
18
|
readonly status: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* A few words more about it, such as "Saved 2 minutes ago", after the status. Shown from `lg` up, where the
|
|
21
|
+
* row has room for them; read out on every window, with the status.
|
|
22
|
+
*/
|
|
23
|
+
readonly note?: ReactNode;
|
|
16
24
|
/** The buttons, main action last. */
|
|
17
25
|
readonly actions: ReactNode;
|
|
26
|
+
/** In the middle of the bar, from `md` up: controls for what is shown, such as the widths of a page. */
|
|
27
|
+
readonly center?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* `screen` for the bar of an editing screen, drawn in the shell's bar inside `AppShell`. `section` for a
|
|
30
|
+
* form inside a screen that has its own header, where it stays at the top of that part. `window` for a
|
|
31
|
+
* bar across a whole window.
|
|
32
|
+
*/
|
|
33
|
+
readonly across?: 'screen' | 'section' | 'window';
|
|
18
34
|
}
|
|
19
35
|
/** The bar that stays at the top of an editing screen: the way back, what is being edited, its state and its save buttons. */
|
|
20
|
-
export declare function SaveBar({ label, back, title, status, actions }: SaveBarProps): import("react").JSX.Element;
|
|
36
|
+
export declare function SaveBar({ label, back, title, status, note, actions, center, across }: SaveBarProps): import("react").JSX.Element | null;
|
|
21
37
|
//# sourceMappingURL=SaveBar.d.ts.map
|