@cntrl-site/components 1.0.116-alpha.0 → 1.0.117

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 (73) hide show
  1. package/dist/{Burger-DyORh_vF.mjs → Burger-BkVgNMGU.mjs} +1 -1
  2. package/dist/{Burger-B4kXX9aY.js → Burger-C3yVbQcq.js} +1 -1
  3. package/dist/Chronicles-BNvvaFYY.mjs +744 -0
  4. package/dist/Chronicles-Dj1gvNjE.js +196 -0
  5. package/dist/ChroniclesComponent-CoOgQZx2.js +1 -0
  6. package/dist/{ChroniclesComponent-jh4v7wp6.mjs → ChroniclesComponent-Szt0H-op.mjs} +542 -491
  7. package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
  8. package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
  9. package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
  10. package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
  11. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
  12. package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
  13. package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
  14. package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
  15. package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
  16. package/dist/{Grid-BzarI5Mc.js → Grid-C4hO8KCr.js} +14 -9
  17. package/dist/{Grid-Z2JZyUdC.mjs → Grid-Dud7PLS9.mjs} +201 -196
  18. package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
  19. package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
  20. package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
  21. package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
  22. package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
  23. package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
  24. package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-BDUs6T0B.mjs} +466 -434
  25. package/dist/LightboxJournal-Bf_rZzmz.js +555 -0
  26. package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-Cuhb2fIR.mjs} +459 -427
  27. package/dist/LightboxStrip-RA4ABUC-.js +418 -0
  28. package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
  29. package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
  30. package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
  31. package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
  32. package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
  33. package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
  34. package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
  35. package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
  36. package/dist/SvgImage-B5mR9y6q.mjs +51 -0
  37. package/dist/SvgImage-DFlmxAoL.js +1 -0
  38. package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
  39. package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
  40. package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
  41. package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
  42. package/dist/{components-C9Fu28pp.mjs → components-DSHc15vW.mjs} +29 -653
  43. package/dist/components-iORMB3kt.js +1 -0
  44. package/dist/elements.js +1 -1
  45. package/dist/elements.mjs +23 -24
  46. package/dist/elements.node.js +1 -1
  47. package/dist/elements.node.mjs +1 -1
  48. package/dist/index.d.ts +2 -4
  49. package/dist/index.js +1 -1
  50. package/dist/index.mjs +38 -61
  51. package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
  52. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
  53. package/dist/sources.js +143 -30
  54. package/dist/sources.mjs +150 -37
  55. package/dist/types/Component.d.ts +0 -7
  56. package/dist/types/SchemaV1.d.ts +3 -3
  57. package/package.json +1 -1
  58. package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
  59. package/dist/Chronicles-D0ojQzOP.js +0 -196
  60. package/dist/ChroniclesComponent-DYPJBI3d.js +0 -1
  61. package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -73
  62. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -594
  63. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -203
  64. package/dist/Components/PopupMenu/popupMenuSnap.d.ts +0 -61
  65. package/dist/LightboxJournal-BFF5aKRz.js +0 -523
  66. package/dist/LightboxStrip-CC2e0_9A.js +0 -386
  67. package/dist/PopupMenu-CYdDyzEt.mjs +0 -1372
  68. package/dist/PopupMenu-Di1fHgho.js +0 -409
  69. package/dist/SvgImage-CwRq9-ec.mjs +0 -56
  70. package/dist/SvgImage-_QN8ngad.js +0 -1
  71. package/dist/components-6QFLq5OI.js +0 -1
  72. package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
  73. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
@@ -1,203 +0,0 @@
1
- export type PopupMenuBlockType = 'text' | 'image' | 'listA' | 'listB';
2
- /** The editor's layout grid, in fractions of the layout width like the grid itself is stored. */
3
- export type PopupMenuGrid = {
4
- columns: number;
5
- columnWidth: number;
6
- gutter: number;
7
- /** The least room kept between two blocks one above the other in a column; none is the gutter. */
8
- rowGap?: number;
9
- /** The vertical rhythm's step, which blocks' tops snap to; none, or 0, leaves them free. */
10
- beat?: number;
11
- };
12
- /**
13
- * A block's place in the popup: `left` from the grid's left edge, `width` across, and `top` down from the popup's
14
- * top, in fractions of the layout width like the popup's other sizes. Blocks sit anywhere on the grid, as an
15
- * article's items do: its columns, the popup's edges and the other blocks are only what they snap to as they are
16
- * moved or resized. A block is always drawn at its top; one reaching below the popup's bottom is scrolled to, the
17
- * popup scrolling down as far as it reaches. `height`, set once an image block was resized by its top or bottom
18
- * edge, holds it to that height, the image cut to fill it. Without it, the block is as tall as its content, as
19
- * text and lists always are.
20
- */
21
- export type PopupMenuPlacement = {
22
- left: number;
23
- width: number;
24
- top: number;
25
- height?: number;
26
- };
27
- /** A placement as saved before blocks were placed freely: `column` skipped from the left edge, `span` columns wide. */
28
- export type PopupMenuColumnPlacement = {
29
- column: number;
30
- span: number;
31
- top: number;
32
- height?: number;
33
- };
34
- /** The popup's height when none is set, as a percentage of the screen's height. */
35
- export declare const DEFAULT_POPUP_MENU_HEIGHT = 60;
36
- /** The screen's height as a fraction of the layout width, where it is not known: a 1440 × 900 desktop. */
37
- export declare const DEFAULT_POPUP_MENU_VIEWPORT_RATIO: number;
38
- /** Where the popup sits across the screen, as a structured block, Catalogue's say, is aligned in the article. */
39
- export declare const POPUP_MENU_ALIGNS: readonly ["left", "center", "right"];
40
- export type PopupMenuAlign = (typeof POPUP_MENU_ALIGNS)[number];
41
- /** The popup's grid when none is set, the desktop default: 12 columns of 99 with gutters of 20. */
42
- export declare const DEFAULT_POPUP_MENU_GRID: PopupMenuGrid;
43
- /**
44
- * The popup's columns as the editor's grid-layout control sets them, as Catalogue's are: `columnsCount` columns
45
- * `entryWidth` wide with `horizontalGap` between them, within `wrapperWidth`, which is at least as wide as they
46
- * are and keeps them centred. `lockedParam` is the size the control holds while the others are changed.
47
- */
48
- export type PopupMenuGridLayout = {
49
- columnsCount?: number;
50
- wrapperWidth?: number;
51
- entryWidth?: number;
52
- horizontalGap?: number;
53
- lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
54
- };
55
- /** The popup's own grid as it is set, sizes in fractions of the layout width like the popup's other sizes. */
56
- export type PopupMenuGridSettings = {
57
- gridLayout?: PopupMenuGridLayout | null;
58
- verticalGap?: number;
59
- /** @deprecated a column count, width and gutter of their own, as a menu saved before `gridLayout` has them */
60
- gridColumns?: number;
61
- /** @deprecated see gridColumns */
62
- gridColumnWidth?: number;
63
- /** @deprecated see gridColumns */
64
- gridGutter?: number;
65
- };
66
- /**
67
- * The grid the popup's blocks are placed on, from its settings: whole columns, at least one, of the entry width
68
- * set, with the gutter set between them and the vertical gap between blocks one above the other. Blocks' tops and
69
- * heights are free, with no rhythm to snap to: the vertical gap alone keeps them apart, and a row height a menu
70
- * was saved with is left behind. A menu saved before `gridLayout` keeps its own columns, width and gutter; what is
71
- * not set at all, as in a menu saved before the popup had a grid of its own, is `fallback`'s, and a vertical gap
72
- * never set is the gutter, the room blocks kept one above the other before it could be set apart.
73
- */
74
- export declare function getPopupMenuGrid(settings: PopupMenuGridSettings, fallback?: PopupMenuGrid): PopupMenuGrid;
75
- /** The least room kept between two blocks one above the other: the vertical gap, or, none set, the gutter. */
76
- export declare function getPopupMenuRowGap(grid: PopupMenuGrid): number;
77
- /** The popup's height as set: a percentage of the screen's height, from 0 to 100. */
78
- export declare function getPopupMenuHeightPercent(settings: {
79
- popupHeight?: number;
80
- }): number;
81
- /**
82
- * The room the popup's blocks are placed in: its whole height, as it has no padding, in fractions of the layout
83
- * width. `viewportRatio` is the screen's height as a fraction of the layout width, a desktop's where not known;
84
- * the popup is measured as drawn once open, so this only places blocks before it is.
85
- */
86
- export declare function getPopupMenuHeight(settings: {
87
- popupHeight?: number;
88
- }, viewportRatio?: number): number;
89
- /** Where the popup is aligned across the screen; none set, as in a menu saved before it could be, is the centre. */
90
- export declare function getPopupMenuAlign(settings: {
91
- popupAlign?: unknown;
92
- }): PopupMenuAlign;
93
- /**
94
- * The popup's width, in fractions of the layout width: its grid's Width, as a structured block, Catalogue's say,
95
- * is as wide as its grid's. A menu saved before its grid had a Width is as wide as its columns and gutters.
96
- */
97
- export declare function getPopupMenuWidth(settings: PopupMenuGridSettings, grid: PopupMenuGrid): number;
98
- export type PopupMenuSides = {
99
- top: number;
100
- right: number;
101
- bottom: number;
102
- left: number;
103
- };
104
- /** A margin or padding as set: a side each, or, saved before it had four, one for every side. */
105
- export type PopupMenuSidesSetting = number | Partial<PopupMenuSides> | null;
106
- /** A margin or padding on every side, in fractions of the layout width; a side not set is none. */
107
- export declare function getPopupMenuSides(sides: PopupMenuSidesSetting | undefined): PopupMenuSides;
108
- export type PopupMenuLayout = {
109
- seed: number;
110
- grid: PopupMenuGrid;
111
- placements: PopupMenuPlacement[];
112
- /** Set once a block was moved by hand, after which the seed no longer gives this layout. */
113
- edited?: boolean;
114
- };
115
- /** A layout as it may be saved: one from before blocks were placed freely has its placements in whole columns. */
116
- export type PopupMenuSavedLayout = Omit<PopupMenuLayout, 'placements'> & {
117
- placements: readonly (PopupMenuPlacement | PopupMenuColumnPlacement)[];
118
- };
119
- /** A column's width on the grid: as set, or, with none set, the columns spread alike over the whole layout width. */
120
- export declare function getPopupMenuColumnWidth(grid: PopupMenuGrid): number;
121
- /** How wide the grid blocks are placed on is: its columns and the gutters between them. */
122
- export declare function getPopupMenuGridWidth(grid: PopupMenuGrid): number;
123
- /** Both edges of every column, from the grid's left edge, left to right. */
124
- export declare function getPopupMenuColumnEdges(grid: PopupMenuGrid): number[];
125
- /** The place of `span` columns from `column` on, at `top`. */
126
- export declare function getPopupMenuColumnsPlacement(grid: PopupMenuGrid, column: number, span: number, top: number, height?: number): PopupMenuPlacement;
127
- /** The least a block may be resized across to: about 8px of a desktop layout. */
128
- export declare function getPopupMenuMinWidth(): number;
129
- /** Where a block without a placement yet sits: at the top left, a quarter of the columns wide. */
130
- export declare function getDefaultPopupMenuPlacement(grid: PopupMenuGrid): PopupMenuPlacement;
131
- /** A saved placement as a free one; one in whole columns is placed where those columns are on `grid`, the grid it was saved on. */
132
- export declare function toPopupMenuPlacement(placement: PopupMenuPlacement | PopupMenuColumnPlacement, grid: PopupMenuGrid): PopupMenuPlacement;
133
- /** A saved layout with every placement a free one; one that has them all so already comes back as it is. */
134
- export declare function normalizePopupMenuLayout(layout: PopupMenuSavedLayout): PopupMenuLayout;
135
- /** How wide each block type may be, as fractions of the grid's columns, and how often a row is left with empty cells. */
136
- export type PopupMenuLayoutRules = {
137
- span: Record<PopupMenuBlockType, {
138
- min: number;
139
- max: number;
140
- }>;
141
- /** Chance that a block starts a new row even though the current one has room left. */
142
- breakChance: number;
143
- };
144
- export declare const defaultPopupMenuLayoutRules: PopupMenuLayoutRules;
145
- /**
146
- * Scatters the blocks over the grid row by row, in their content order so that reading and tab order
147
- * stay as the user wrote them. Every block of a type takes the one whole-column span picked for that
148
- * type, and lands at a random free column of the current row; a block that no longer fits, or one the
149
- * dice break, opens the next row. The rows are spread evenly down the popup's `height`, each on a beat
150
- * of the grid's rhythm, their blocks' tops level, which reads the same whatever the blocks' heights turn
151
- * out to be. The same seed on the same grid always gives the same layout.
152
- */
153
- export declare function generatePopupMenuLayout(blocks: readonly PopupMenuBlockType[], grid: PopupMenuGrid, seed: number, height: number, rules?: PopupMenuLayoutRules): PopupMenuLayout;
154
- /**
155
- * The top nearest to `top` on the grid's rhythm, within `room`, the most a top may be for the block to end
156
- * inside the popup: past it, the last beat the block still ends above.
157
- */
158
- export declare function snapPopupMenuTop(grid: PopupMenuGrid, top: number, room?: number): number;
159
- /** The least a block may be resized to: a beat of the rhythm, or, where there is none, about 8px of a desktop layout. */
160
- export declare function getPopupMenuMinHeight(grid: PopupMenuGrid): number;
161
- /**
162
- * The height nearest to `height` in whole beats of the grid's rhythm, at least one, and no more than `room`,
163
- * the most the block may be for it to end inside the popup: past it, the most beats that still fit.
164
- */
165
- export declare function snapPopupMenuHeight(grid: PopupMenuGrid, height: number, room?: number): number;
166
- /** Whether two grids place blocks alike: the same columns, column width, gutter, vertical gap and rhythm. */
167
- export declare function isSamePopupMenuGrid(a: PopupMenuGrid, b: PopupMenuGrid): boolean;
168
- /**
169
- * The layout on another grid, the layout grid as it is now rather than as it was when the layout was saved.
170
- * Every block keeps its share of the grid's width, so that blocks on its columns stay on them as the columns
171
- * widen or narrow, and stays within it; tops and set heights are kept. A layout already on `grid` comes back as it is.
172
- */
173
- export declare function fitPopupMenuLayoutToGrid(layout: PopupMenuLayout, grid: PopupMenuGrid): PopupMenuLayout;
174
- /**
175
- * The room blocks are placed in and every block's height, in fractions of the layout width, as drawn. Blocks are
176
- * moved within the room; settled, they are kept within it where they can be.
177
- */
178
- export type PopupMenuMeasure = {
179
- height: number;
180
- heights: readonly number[];
181
- };
182
- /**
183
- * The layout with one block moved to another left and top, keeping its size, held within the grid's width and,
184
- * given the popup measured, where the block still ends inside it. Null when, measured, the block would cover part
185
- * of another or come within a vertical gap of one above or below it.
186
- */
187
- export declare function movePopupMenuBlock(layout: PopupMenuLayout, index: number, left: number, top: number, measure?: PopupMenuMeasure): PopupMenuLayout | null;
188
- /**
189
- * The layout with one block resized to `next`: at least the least width and height, and within the grid's width
190
- * and, measured, the popup's height. Null on the same terms as movePopupMenuBlock. A block without a height keeps
191
- * the one it was measured at.
192
- */
193
- export declare function resizePopupMenuBlock(layout: PopupMenuLayout, index: number, next: PopupMenuPlacement, measure?: PopupMenuMeasure): PopupMenuLayout | null;
194
- /**
195
- * The layout with every block that comes within the vertical gap of one above it, in a column they share, pushed down
196
- * below it onto the next beat. A generated layout spreads its rows without knowing how tall the blocks turn
197
- * out, so a tall image or list can reach into the next row. Blocks are taken from the top down, each below
198
- * every one already settled, so a pushed block pushes the ones under it in turn. A block pushed so low that it
199
- * would reach below the popup's bottom, `measure.height`, moves instead to the column start nearest it where it
200
- * is pushed least and still ends inside the popup, and stays where it was pushed, the popup scrolling to it, only
201
- * where none does. A layout that crowds nowhere comes back as it is.
202
- */
203
- export declare function settlePopupMenuLayout(layout: PopupMenuLayout, measure: PopupMenuMeasure): PopupMenuLayout;
@@ -1,61 +0,0 @@
1
- import { PopupMenuGrid, PopupMenuLayout, PopupMenuMeasure, PopupMenuPlacement } from './popupMenuLayout';
2
- /**
3
- * Snapping for the popup's blocks as they are moved and resized on the canvas, as an article's items snap: a block
4
- * goes where the pointer takes it, and an edge or its centre comes to a line only once it is within a few pixels of
5
- * one. All in fractions of the layout width, `xs` from the grid's left edge and `ys` from the popup's top.
6
- * `baselines` are what a text block's first line's baseline snaps to, as an article's text snaps by its baselines:
7
- * the grid's rows and the other text blocks' first baselines.
8
- */
9
- export type PopupMenuSnapLines = {
10
- xs: number[];
11
- ys: number[];
12
- baselines?: number[];
13
- };
14
- /** How near, in screen pixels, a block's edge or centre comes to a line before it snaps to it, as in an article. */
15
- export declare const POPUP_MENU_SNAP_MARGIN_PX = 5;
16
- /** The handles a block is resized by on the canvas, by the edges each one takes along. */
17
- export type PopupMenuResizeHandle = 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
18
- /**
19
- * The grid's rows, as the editor draws them: a line every beat from the popup's top where the grid has a rhythm,
20
- * else one every vertical gap, down to its bottom.
21
- */
22
- export declare function getPopupMenuGridRows(grid: PopupMenuGrid, room: number): number[];
23
- /**
24
- * The lines block `index` snaps to: both edges of every column, the grid's edges and centre, the popup's top and
25
- * bottom, every beat where the grid has a rhythm, and the other blocks' edges and centres, and a vertical gap above
26
- * and below each, where a block may sit right under or over it. A text block's first baseline snaps to the grid's
27
- * rows and to the other text blocks' first baselines, `baselines` being each block's, down from its top, where it
28
- * has one.
29
- */
30
- export declare function getPopupMenuSnapLines(layout: PopupMenuLayout, index: number, measure: PopupMenuMeasure, baselines?: readonly (number | null | undefined)[]): PopupMenuSnapLines;
31
- /** The lines any of `points` is on, to draw while the block is there; a baseline on any of `lines.baselines`. */
32
- export declare function getPopupMenuSnapGuides(points: PopupMenuSnapLines, lines: PopupMenuSnapLines): PopupMenuSnapLines;
33
- export type PopupMenuSnapMargin = {
34
- x: number;
35
- y: number;
36
- };
37
- export type PopupMenuSnapped = {
38
- placement: PopupMenuPlacement;
39
- guides: PopupMenuSnapLines;
40
- };
41
- /**
42
- * A block moved from `start`, `height` tall, by `dx` and `dy`: its left edge, centre or right edge snapped to the
43
- * nearest line across, and its top, middle or bottom to the nearest line down, or, for a text block, its first
44
- * line's `baseline`, that far down from its top, to the nearest of `lines.baselines`, whichever is nearer, each within
45
- * `margin`; then held within the grid's width and the popup's height, `room`.
46
- */
47
- export declare function snapPopupMenuMove(start: PopupMenuPlacement, height: number, dx: number, dy: number, lines: PopupMenuSnapLines, margin: PopupMenuSnapMargin, gridWidth: number, room: number, baseline?: number | null): PopupMenuSnapped;
48
- export type PopupMenuResizeOptions = {
49
- /** Shift: a corner keeps the block's shape as it was when the drag started. */
50
- keepRatio?: boolean;
51
- /** Alt: the opposite edge moves alike the other way, the block resized about its centre. */
52
- fromCenter?: boolean;
53
- };
54
- /**
55
- * A block resized from `start`, `height` tall, by one of its handles moved by `dx` and `dy`, as an article's items
56
- * are: the edge it is dragged by snaps to the nearest line within `margin`, the other staying where it was, or,
57
- * from its centre, moving alike the other way. Held at the least width and height at least, and within the grid's
58
- * width and the popup's height, `room`. A block that is not resized down keeps its height unset, as tall as its
59
- * content.
60
- */
61
- export declare function snapPopupMenuResize(start: PopupMenuPlacement, height: number, handle: PopupMenuResizeHandle, dx: number, dy: number, lines: PopupMenuSnapLines, margin: PopupMenuSnapMargin, gridWidth: number, room: number, minHeight: number, { keepRatio, fromCenter }?: PopupMenuResizeOptions): PopupMenuSnapped;