@vectoriox/iox-ui 5.36.0 → 5.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions-core/index.d.ts +17 -3
- package/composite-core/index.d.ts +463 -31
- package/design-core/index.d.ts +130 -3
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +33 -3
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +1062 -121
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +172 -3
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +410 -10
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-media-core.mjs +571 -0
- package/fesm2022/vectoriox-iox-ui-media-core.mjs.map +1 -0
- package/fesm2022/vectoriox-iox-ui.mjs +482 -120
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +167 -4
- package/index.d.ts +209 -25
- package/media-core/index.d.ts +277 -0
- package/media-core/package.json +3 -0
- package/package.json +5 -1
- package/src/actions-core/action.model.ts +4 -2
- package/src/actions-core/element-actions.ts +37 -2
- package/src/composite-core/accordion-runtime.ts +117 -28
- package/src/composite-core/accordion.ts +89 -45
- package/src/composite-core/composite-kinds.ts +110 -0
- package/src/composite-core/composite-node.ts +15 -0
- package/src/composite-core/disclosure.ts +125 -0
- package/src/composite-core/lightbox.ts +192 -0
- package/src/composite-core/public-api.ts +7 -1
- package/src/composite-core/slider-runtime.ts +180 -0
- package/src/composite-core/slider.ts +378 -0
- package/src/composite-core/structure.ts +25 -5
- package/src/design-core/element-styles.ts +27 -0
- package/src/design-core/flavor-spec.generated.ts +146 -2
- package/src/generation-core/baseline-roles.ts +2 -0
- package/src/generation-core/compose-site.ts +80 -4
- package/src/generation-core/node-baselines.generated.ts +148 -4
- package/src/generation-core/patterns.ts +17 -0
- package/src/generation-core/site-spec.generated.ts +164 -0
- package/src/media-core/public-api.ts +9 -0
- package/src/media-core/video-runtime.ts +239 -0
- package/src/media-core/video.ts +443 -0
- package/styles/iox-design.css +96 -0
|
@@ -34,6 +34,9 @@ interface CompositeNode extends ElementStyleTarget {
|
|
|
34
34
|
* (the builder's `createConfig`, generation-core's `createSerializedNode`), with these props and this
|
|
35
35
|
* element style. `key` is stable per recipe node — a consumer that needs deterministic ids builds them
|
|
36
36
|
* from it (generation-core: `<root id>-<key>`). */
|
|
37
|
+
/** `elementStyle: NO_ELEMENT_STYLE` asks for a node that wears NO element style (undefined / null = the type's default,
|
|
38
|
+
* as both node factories have always read it): a migrated slider's bare chevrons, a lightbox's slide (CC3). */
|
|
39
|
+
declare const NO_ELEMENT_STYLE = "";
|
|
37
40
|
interface CompositeNodeSpec {
|
|
38
41
|
key: string;
|
|
39
42
|
type: string;
|
|
@@ -41,6 +44,9 @@ interface CompositeNodeSpec {
|
|
|
41
44
|
elementStyle?: string | null;
|
|
42
45
|
}
|
|
43
46
|
type CompositeNodeFactory = (spec: CompositeNodeSpec) => CompositeNode;
|
|
47
|
+
/** A recipe part: a NEW node (`create`) playing `role` under `label`, with the layout `base` styles its recipe
|
|
48
|
+
* gives it — its LOOK is its element style. Shared by every recipe (Accordion, Disclosure). */
|
|
49
|
+
declare function makeCompositePart(create: CompositeNodeFactory, spec: CompositeNodeSpec, role: string | null, label: string | undefined, base?: Readonly<Record<string, string>>): CompositeNode;
|
|
44
50
|
/** A content trait's value — `traits[].default` on a builder node, `props[name]` on a saved one. */
|
|
45
51
|
declare function readProp(node: CompositeNode, name: string): unknown;
|
|
46
52
|
/** Write a content trait. False when a builder node has no such trait (the value would be dropped). */
|
|
@@ -68,6 +74,68 @@ declare function parentInComposite(root: CompositeNode, node: CompositeNode): Co
|
|
|
68
74
|
/** Detach `node` from its parent inside `root`. True when it was found. */
|
|
69
75
|
declare function removeFromComposite(root: CompositeNode, node: CompositeNode): boolean;
|
|
70
76
|
|
|
77
|
+
/**
|
|
78
|
+
* The open/close composites' kinds and roles (CC2 Accordion, CC2.1 Disclosure — composite plan T9 / T21). ONE
|
|
79
|
+
* family: a Disclosure is a one-item accordion whose ROOT is its item, so both run the same state machine, the
|
|
80
|
+
* same attribute planners and the same runtime (`accordion-runtime.ts`). Every consumer that treats "an item",
|
|
81
|
+
* "a header" or "a panel" alike asks these predicates, never a role literal.
|
|
82
|
+
*/
|
|
83
|
+
declare enum CompositeKind {
|
|
84
|
+
Accordion = "accordion",
|
|
85
|
+
Disclosure = "disclosure"
|
|
86
|
+
}
|
|
87
|
+
declare enum AccordionRole {
|
|
88
|
+
Accordion = "accordion",
|
|
89
|
+
Item = "accordion.item",
|
|
90
|
+
Trigger = "accordion.trigger",
|
|
91
|
+
Icon = "accordion.icon",
|
|
92
|
+
Panel = "accordion.panel"
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* DISCLOSURE ("Read more") — one trigger, one panel. The root IS its item (it carries the item key and
|
|
96
|
+
* `data-iox-on`); the trigger holds two words, the one shown while closed (`more`) and the one shown while open
|
|
97
|
+
* (`less`), swapped by the Item open state — never by script.
|
|
98
|
+
*/
|
|
99
|
+
declare enum DisclosureRole {
|
|
100
|
+
Disclosure = "disclosure",
|
|
101
|
+
Trigger = "disclosure.trigger",
|
|
102
|
+
More = "disclosure.more",
|
|
103
|
+
Less = "disclosure.less",
|
|
104
|
+
Icon = "disclosure.icon",
|
|
105
|
+
Panel = "disclosure.panel"
|
|
106
|
+
}
|
|
107
|
+
interface RoleLike$2 {
|
|
108
|
+
role?: string | null;
|
|
109
|
+
}
|
|
110
|
+
/** The roles each kind plays in the shared runtime. */
|
|
111
|
+
interface CompositeKindRoles {
|
|
112
|
+
root: string;
|
|
113
|
+
item: string;
|
|
114
|
+
trigger: string;
|
|
115
|
+
panel: string;
|
|
116
|
+
icon: string;
|
|
117
|
+
}
|
|
118
|
+
declare const COMPOSITE_KIND_ROLES: Readonly<Record<CompositeKind, CompositeKindRoles>>;
|
|
119
|
+
/** The kind a role belongs to (`disclosure.panel` → Disclosure), or null for any other role. */
|
|
120
|
+
declare function compositeKindOfRole(role: string | null | undefined): CompositeKind | null;
|
|
121
|
+
/** A root that runs the open/close runtime (an Accordion or a Disclosure). */
|
|
122
|
+
declare function isCompositeRoot(node: RoleLike$2 | null | undefined): boolean;
|
|
123
|
+
/** An ITEM — an accordion's item, or a disclosure (its own item). */
|
|
124
|
+
declare function isCompositeItem(node: RoleLike$2 | null | undefined): boolean;
|
|
125
|
+
/** A trigger — rendered as a `<button>` that opens its item, never a link. */
|
|
126
|
+
declare function isCompositeTrigger(node: RoleLike$2 | null | undefined): boolean;
|
|
127
|
+
/** A panel — rendered inside the track + region the one hiding rule collapses. */
|
|
128
|
+
declare function isCompositePanel(node: RoleLike$2 | null | undefined): boolean;
|
|
129
|
+
declare function isDisclosureRoot(node: RoleLike$2 | null | undefined): boolean;
|
|
130
|
+
/** True for any part of a disclosure (its root included). */
|
|
131
|
+
declare function isDisclosurePart(node: RoleLike$2 | null | undefined): boolean;
|
|
132
|
+
/** The composite root a node belongs to: the nearest ancestor (or the node itself) that is one. `path` = the
|
|
133
|
+
* node's ancestors, root first. */
|
|
134
|
+
declare function compositeRootOf<T extends RoleLike$2>(node: T, path: ReadonlyArray<T>): T | null;
|
|
135
|
+
/** The item a node sits in — the nearest item of either kind (itself when it is one) — or null. An accordion
|
|
136
|
+
* root ends the walk (its items are below it). */
|
|
137
|
+
declare function compositeItemOf<T extends RoleLike$2>(node: T, path: ReadonlyArray<T>): T | null;
|
|
138
|
+
|
|
71
139
|
/**
|
|
72
140
|
* ACCORDION (CC2 — composite K1; complex-components boards 3, 4 and 9, APPROVED 2026-10-20). Not a
|
|
73
141
|
* component: a recipe of ordinary nodes, each part carrying a role, so every part is selectable on the
|
|
@@ -86,13 +154,6 @@ declare function removeFromComposite(root: CompositeNode, node: CompositeNode):
|
|
|
86
154
|
* (`nextAccordionState`), the ARIA and DOM state one planner (`accordionItemState` and the attribute
|
|
87
155
|
* functions), the keyboard one key map — read by the builder canvas, both engine paths and the composer.
|
|
88
156
|
*/
|
|
89
|
-
declare enum AccordionRole {
|
|
90
|
-
Accordion = "accordion",
|
|
91
|
-
Item = "accordion.item",
|
|
92
|
-
Trigger = "accordion.trigger",
|
|
93
|
-
Icon = "accordion.icon",
|
|
94
|
-
Panel = "accordion.panel"
|
|
95
|
-
}
|
|
96
157
|
/** The behaviour options a composite root stores as ordinary TRAITS (composite plan §3). */
|
|
97
158
|
declare enum CompositeBehaviourTrait {
|
|
98
159
|
/** Several items may be open at once ("Allow several open"). */
|
|
@@ -138,6 +199,9 @@ interface AccordionOptions {
|
|
|
138
199
|
defaultOn?: AccordionDefaultOn;
|
|
139
200
|
icon?: AccordionIcon;
|
|
140
201
|
}
|
|
202
|
+
/** The icon of an item (an accordion's, or a disclosure's — `role`); its Item-open state (the turn) is driven by
|
|
203
|
+
* ITS item (`stateTriggers`). ONE builder for both kinds. */
|
|
204
|
+
declare function buildCompositeIcon(create: CompositeNodeFactory, key: string, icon: Exclude<AccordionIcon, AccordionIcon.None>, itemId?: string, role?: string): CompositeNode;
|
|
141
205
|
/** One item: header (question + icon) and panel (answer). `key` makes every part's recipe key unique. */
|
|
142
206
|
declare function buildAccordionItem(create: CompositeNodeFactory, words: AccordionWords, itemKey: string, icon?: AccordionIcon): CompositeNode;
|
|
143
207
|
/** A fresh Accordion: three items, one open at a time, the first open by default (board 4). */
|
|
@@ -170,11 +234,14 @@ interface AccordionBehaviour {
|
|
|
170
234
|
declare function accordionBehaviour(root: CompositeNode | null | undefined): AccordionBehaviour;
|
|
171
235
|
/** Behaviour ▸ Allow several open / Open by default. False when the node has no such trait. */
|
|
172
236
|
declare function setAccordionBehaviour(root: CompositeNode, patch: Partial<AccordionBehaviour>): boolean;
|
|
173
|
-
/** The header of an item. */
|
|
237
|
+
/** The header of an item (either kind). */
|
|
174
238
|
declare function accordionTriggerOf(item: CompositeNode): CompositeNode | undefined;
|
|
175
|
-
/** The panel of an item. */
|
|
239
|
+
/** The panel of an item (either kind). */
|
|
176
240
|
declare function accordionPanelOf(item: CompositeNode): CompositeNode | undefined;
|
|
177
|
-
/**
|
|
241
|
+
/** A root's items — an accordion's (`accordionItems`), or a disclosure, which is its own one item. */
|
|
242
|
+
declare function compositeItems(root: CompositeNode): CompositeNode[];
|
|
243
|
+
/** The question: the first Heading inside the header — a disclosure's toggle holds no heading, so its first word
|
|
244
|
+
* (the Text shown while closed, "Read more"). */
|
|
178
245
|
declare function accordionQuestionOf(item: CompositeNode): CompositeNode | undefined;
|
|
179
246
|
/** The answer: the first Text inside the panel. */
|
|
180
247
|
declare function accordionAnswerOf(item: CompositeNode): CompositeNode | undefined;
|
|
@@ -199,7 +266,7 @@ declare enum AccordionEditRefusal {
|
|
|
199
266
|
}
|
|
200
267
|
/** Why removing `item` from `root` is refused, or null. */
|
|
201
268
|
declare function accordionRemovalRefusal(root: CompositeNode | null | undefined, item: CompositeNode | null | undefined): AccordionEditRefusal | null;
|
|
202
|
-
/** The icon the
|
|
269
|
+
/** The icon the composite's items wear now (the first item's; None when it has no icon). Either kind. */
|
|
203
270
|
declare function detectAccordionIcon(root: CompositeNode): AccordionIcon;
|
|
204
271
|
/**
|
|
205
272
|
* Behaviour ▸ Icon: every item's header shows the chevron, the plus, or no icon. A switch between glyphs
|
|
@@ -213,8 +280,10 @@ declare function itemOpenTriggerIds(root: CompositeNode): void;
|
|
|
213
280
|
declare function initialAccordionOpen(keys: ReadonlyArray<string>, defaultOn: AccordionDefaultOn): Set<string>;
|
|
214
281
|
/** The open keys after toggling `key`: one at a time closes the others; several leaves them. */
|
|
215
282
|
declare function nextAccordionState(open: ReadonlySet<string>, key: string, behaviour: Pick<AccordionBehaviour, 'multiple'>): Set<string>;
|
|
216
|
-
/** The open keys after OPENING `key` (find-in-page, selecting into a closed panel). */
|
|
283
|
+
/** The open keys after OPENING `key` (find-in-page, selecting into a closed panel, the `openItem` action). */
|
|
217
284
|
declare function openAccordionItem(open: ReadonlySet<string>, key: string, behaviour: Pick<AccordionBehaviour, 'multiple'>): Set<string>;
|
|
285
|
+
/** The open keys after CLOSING `key` (the `closeItem` action). */
|
|
286
|
+
declare function closeAccordionItem(open: ReadonlySet<string>, key: string): Set<string>;
|
|
218
287
|
declare enum AccordionKeyAction {
|
|
219
288
|
Next = "next",
|
|
220
289
|
Previous = "previous",
|
|
@@ -233,23 +302,32 @@ interface AccordionDomIds {
|
|
|
233
302
|
trigger: string;
|
|
234
303
|
panel: string;
|
|
235
304
|
}
|
|
236
|
-
/** The ARIA pairing ids of an item: unique per
|
|
237
|
-
declare function accordionDomIds(rootId: string, itemKey: string): AccordionDomIds;
|
|
305
|
+
/** The ARIA pairing ids of an item: unique per composite (its SCOPE id — `compositeScopeId`) and per item (its key). */
|
|
306
|
+
declare function accordionDomIds(rootId: string, itemKey: string, kind?: CompositeKind): AccordionDomIds;
|
|
307
|
+
/**
|
|
308
|
+
* The id a rendered composite's ARIA ids are built from: its node id, and — when it sits inside repeated rows —
|
|
309
|
+
* every enclosing row's identity, outermost first (vectoriox/iox-ui#20: an accordion repeated per card used to
|
|
310
|
+
* pair every row's header with the FIRST row's panel). The engine folds each row's `rowItemKey`; the builder
|
|
311
|
+
* canvas its preview row's index. Unrepeated, it is the node id unchanged.
|
|
312
|
+
*/
|
|
313
|
+
declare function compositeScopeId(rootId: string, rowKeys?: ReadonlyArray<string>): string;
|
|
238
314
|
/** One item's render state: its identity, whether it is open, and its ARIA ids. */
|
|
239
315
|
interface AccordionItemState {
|
|
316
|
+
kind: CompositeKind;
|
|
240
317
|
key: string;
|
|
241
318
|
index: number;
|
|
242
319
|
on: boolean;
|
|
243
320
|
ids: AccordionDomIds;
|
|
244
321
|
}
|
|
245
|
-
/** The render scope of one
|
|
322
|
+
/** The render scope of one composite: its kind, scope id, behaviour and every item key in order. */
|
|
246
323
|
interface AccordionScope {
|
|
324
|
+
kind: CompositeKind;
|
|
247
325
|
rootId: string;
|
|
248
326
|
behaviour: AccordionBehaviour;
|
|
249
327
|
keys: ReadonlyArray<string>;
|
|
250
328
|
open: ReadonlySet<string>;
|
|
251
329
|
}
|
|
252
|
-
declare function accordionScope(rootId: string, behaviour: AccordionBehaviour, keys: ReadonlyArray<string
|
|
330
|
+
declare function accordionScope(rootId: string, behaviour: AccordionBehaviour, keys: ReadonlyArray<string>, kind?: CompositeKind): AccordionScope;
|
|
253
331
|
declare function accordionItemState(scope: AccordionScope, index: number): AccordionItemState;
|
|
254
332
|
/** Attribute values: a string, or '' for a present boolean attribute. Absent attributes are left out. */
|
|
255
333
|
type DomAttributes = Record<string, string>;
|
|
@@ -259,6 +337,9 @@ declare const ITEM_KEY_ATTRIBUTE = "data-iox-item-key";
|
|
|
259
337
|
declare const COMPOSITE_ATTRIBUTE = "data-iox-composite";
|
|
260
338
|
declare const MULTIPLE_ATTRIBUTE = "data-iox-multiple";
|
|
261
339
|
declare const DEFAULT_ON_ATTRIBUTE = "data-iox-default-on";
|
|
340
|
+
/** The scope id the ARIA ids are built from (`compositeScopeId`), written by the engine so the runtime re-stamps
|
|
341
|
+
* exactly the ids the server rendered. */
|
|
342
|
+
declare const SCOPE_ATTRIBUTE = "data-iox-scope";
|
|
262
343
|
/** The value a closed panel's region carries: find-in-page can still reveal it (D9, board 4). */
|
|
263
344
|
declare const UNTIL_FOUND = "until-found";
|
|
264
345
|
/** The structural classes the renderers write around an accordion's parts (no node owns them). */
|
|
@@ -268,13 +349,16 @@ declare enum AccordionClass {
|
|
|
268
349
|
Track = "iox-accordion-track",
|
|
269
350
|
Region = "iox-accordion-region"
|
|
270
351
|
}
|
|
271
|
-
declare function accordionRootAttributes(behaviour: AccordionBehaviour): DomAttributes;
|
|
352
|
+
declare function accordionRootAttributes(behaviour: AccordionBehaviour, kind?: CompositeKind, scopeId?: string): DomAttributes;
|
|
272
353
|
declare function accordionItemAttributes(state: AccordionItemState): DomAttributes;
|
|
273
354
|
declare function accordionTriggerAttributes(state: AccordionItemState): DomAttributes;
|
|
274
355
|
/** The track wrapping a panel: its row collapses to 0 while closed (the ONE hiding rule, iox-design.css). */
|
|
275
356
|
declare function accordionTrackAttributes(state: AccordionItemState): DomAttributes;
|
|
276
|
-
/** The region the panel sits in: `hidden="until-found"` while closed, so its words stay in the page.
|
|
357
|
+
/** The region the panel sits in: `hidden="until-found"` while closed, so its words stay in the page. An accordion's
|
|
358
|
+
* is a labelled `region` (APG accordion); a disclosure's is a plain block (APG disclosure: the button names it). */
|
|
277
359
|
declare function accordionRegionAttributes(state: AccordionItemState): DomAttributes;
|
|
360
|
+
/** True when a region of this kind is a labelled `role=region`. */
|
|
361
|
+
declare function hasLabelledRegion(kind: CompositeKind): boolean;
|
|
278
362
|
declare function accordionPanelAttributes(state: AccordionItemState): DomAttributes;
|
|
279
363
|
/** `attrs` as an HTML attribute string (` a="b" c`), values escaped by `esc`. */
|
|
280
364
|
declare function serializeDomAttributes(attrs: DomAttributes, esc: (v: string) => string): string;
|
|
@@ -322,13 +406,17 @@ declare function accordionPartStyle(node: CompositeNode, name: string): unknown;
|
|
|
322
406
|
* paths render the same markup). It reads the markup the renderers write (iox-design.css + accordion.ts's
|
|
323
407
|
* attribute planners), so the server's first paint and every later state agree:
|
|
324
408
|
*
|
|
325
|
-
* [root] data-iox-composite="accordion" data-iox-default-on [data-iox-multiple]
|
|
326
|
-
* its role class may sit on a wrapper host, as the engine's component-path Repeater draws it)
|
|
409
|
+
* [root] data-iox-composite="accordion" data-iox-default-on [data-iox-multiple] [data-iox-scope] (the node's
|
|
410
|
+
* own element — its role class may sit on a wrapper host, as the engine's component-path Repeater draws it)
|
|
327
411
|
* .iox-role-accordion-item data-iox-item-key [data-iox-on]
|
|
328
412
|
* hN.iox-accordion-heading > button.iox-accordion-button id aria-expanded aria-controls
|
|
329
413
|
* .iox-accordion-track [data-iox-on] > .iox-accordion-region role=region [hidden=until-found]
|
|
330
414
|
* .iox-role-accordion-panel
|
|
331
415
|
*
|
|
416
|
+
* The DISCLOSURE (CC2.1) runs on this same runtime: `data-iox-composite="disclosure"` on a root that IS its one
|
|
417
|
+
* item (it carries the key and `data-iox-on`), its button straight inside it (no heading), its panel in the same
|
|
418
|
+
* track + region (a plain block — no `role=region`), and no arrow keys (one button).
|
|
419
|
+
*
|
|
332
420
|
* It owns: a click on a header toggles its item; ↓ ↑ Home End move between the headers of THIS accordion
|
|
333
421
|
* (a nested one keeps its own); find-in-page (`beforematch`) opens the item that holds the match; a closed
|
|
334
422
|
* panel gets `hidden="until-found"` after its track has collapsed (at once under reduced motion). Every
|
|
@@ -339,8 +427,11 @@ declare function accordionPartStyle(node: CompositeNode, name: string): unknown;
|
|
|
339
427
|
declare const ITEM_ON_EVENT = "iox-item-on";
|
|
340
428
|
declare const ITEM_OFF_EVENT = "iox-item-off";
|
|
341
429
|
interface AccordionRuntimeOptions {
|
|
342
|
-
/** The
|
|
343
|
-
|
|
430
|
+
/** The composite's scope id — the ARIA ids' prefix (else the root's `data-iox-scope`, else its `iox-node-<id>`). A
|
|
431
|
+
* function is read at every stamp (the builder canvas: a preview row's index is known once it is in the page). */
|
|
432
|
+
rootId?: string | (() => string);
|
|
433
|
+
/** Accordion or Disclosure (else read from the root's `data-iox-composite`). */
|
|
434
|
+
kind?: CompositeKind;
|
|
344
435
|
/** The behaviour (else read from the root's data attributes). */
|
|
345
436
|
behaviour?: AccordionBehaviour;
|
|
346
437
|
/** Keys forced open on top of the live state (the builder's design state). */
|
|
@@ -350,9 +441,9 @@ interface AccordionRuntimeOptions {
|
|
|
350
441
|
/** True to stop motion (default: the visitor's reduced-motion setting). */
|
|
351
442
|
reducedMotion?: () => boolean;
|
|
352
443
|
}
|
|
353
|
-
/** The accordion an element belongs to (the element itself when it is a root). */
|
|
444
|
+
/** The composite (accordion or disclosure) an element belongs to (the element itself when it is a root). */
|
|
354
445
|
declare function closestAccordion(el: Element | null | undefined): HTMLElement | null;
|
|
355
|
-
/** The item an element sits in (itself when it is one). */
|
|
446
|
+
/** The item an element sits in (itself when it is one) — an accordion item, or a disclosure. */
|
|
356
447
|
declare function closestAccordionItem(el: Element | null | undefined): HTMLElement | null;
|
|
357
448
|
/** Subscribe to an item turning on / off — what the `itemOn` / `itemOff` interaction triggers listen to. The
|
|
358
449
|
* item is the element's own item (the element itself when it is one). Returns the unsubscribe. */
|
|
@@ -370,11 +461,12 @@ declare class AccordionRuntime {
|
|
|
370
461
|
private behaviourValue;
|
|
371
462
|
/** The builder attaches a root before its items render: the saved default is applied once they do. */
|
|
372
463
|
private awaitingItems;
|
|
464
|
+
readonly kind: CompositeKind;
|
|
373
465
|
constructor(root: HTMLElement, options?: AccordionRuntimeOptions);
|
|
374
466
|
get behaviour(): AccordionBehaviour;
|
|
375
467
|
/** The behaviour changed in the panel: re-read, and start from the new default. */
|
|
376
468
|
setBehaviour(behaviour: AccordionBehaviour): void;
|
|
377
|
-
/** THIS
|
|
469
|
+
/** THIS composite's items, in document order (a nested composite's items are its own); a disclosure's is itself. */
|
|
378
470
|
items(): HTMLElement[];
|
|
379
471
|
/** The open keys the live state holds (before anything forced). */
|
|
380
472
|
get liveKeys(): ReadonlySet<string>;
|
|
@@ -383,6 +475,9 @@ declare class AccordionRuntime {
|
|
|
383
475
|
keyOf(item: Element, items?: HTMLElement[]): string;
|
|
384
476
|
toggle(key: string): void;
|
|
385
477
|
open(key: string): void;
|
|
478
|
+
close(key: string): void;
|
|
479
|
+
/** Run an item action (`openItem` / `closeItem` / `toggleItem`, T14) on `key`. True when it shows open after. */
|
|
480
|
+
run(action: CompositeItemAction, key: string): boolean;
|
|
386
481
|
/** Back to the saved default ("Showing on canvas ▸ As saved"). */
|
|
387
482
|
resetLive(): void;
|
|
388
483
|
/** The forced set changed (builder design state): show it. */
|
|
@@ -401,13 +496,73 @@ declare class AccordionRuntime {
|
|
|
401
496
|
private readonly onKeydown;
|
|
402
497
|
private readonly onBeforeMatch;
|
|
403
498
|
}
|
|
404
|
-
/** Attach the runtime to one rendered
|
|
499
|
+
/** Attach the runtime to one rendered composite root, unless it already runs one. Returns the NEW runtime, or
|
|
405
500
|
* null when the root already had one (so a caller destroys only what it created). */
|
|
406
501
|
declare function attachAccordionAt(root: HTMLElement, options?: Omit<AccordionRuntimeOptions, 'rootId' | 'behaviour'>): AccordionRuntime | null;
|
|
407
502
|
/** Attach the runtime to every accordion under `container` that has none yet. Returns the new runtimes. */
|
|
408
503
|
declare function attachAccordions(container: ParentNode, options?: Omit<AccordionRuntimeOptions, 'rootId' | 'behaviour'>): AccordionRuntime[];
|
|
409
504
|
/** Detach a runtime `attachAccordions` created. */
|
|
410
505
|
declare function detachAccordion(runtime: AccordionRuntime): void;
|
|
506
|
+
/** The repeated rows an element sits in, outermost first — each row's index as its row wrappers stamp it
|
|
507
|
+
* (`data-iox-row-idx`: the builder's Repeater rows, the engine's component path). The builder folds them into a
|
|
508
|
+
* composite's scope id (`compositeScopeId`, vectoriox/iox-ui#20); the element itself is not counted. */
|
|
509
|
+
declare function compositeRowKeys(el: Element | null | undefined): string[];
|
|
510
|
+
/** The runtime running a composite root, or null. */
|
|
511
|
+
declare function accordionRuntimeOf(root: Element | null | undefined): AccordionRuntime | null;
|
|
512
|
+
/** What an item action does to its target item (actions-core `openItem` / `closeItem` / `toggleItem`). */
|
|
513
|
+
declare enum CompositeItemAction {
|
|
514
|
+
Open = "open",
|
|
515
|
+
Close = "close",
|
|
516
|
+
Toggle = "toggle"
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Run an item action on the element of an ITEM (an accordion item, or a disclosure) — the `openItem` /
|
|
520
|
+
* `closeItem` / `toggleItem` interaction actions, on the canvas and on the live site through this one function.
|
|
521
|
+
* Returns whether the item shows open afterwards, or null when `el` is in no running composite.
|
|
522
|
+
*/
|
|
523
|
+
declare function runCompositeItemAction(el: Element | null | undefined, action: CompositeItemAction): boolean | null;
|
|
524
|
+
/** True when an item an action just opened is out of view and the page should scroll to it (T14: "opens that item
|
|
525
|
+
* and scrolls to it") — never when its head is already on screen, so a button beside it does not jolt the page. */
|
|
526
|
+
declare function shouldScrollToItem(top: number, viewportHeight: number): boolean;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* DISCLOSURE / "Read more" (CC2.1 — composite T21). Not a component: a recipe of ordinary nodes on the
|
|
530
|
+
* ACCORDION's machinery — a disclosure is a one-item accordion whose root is its item, so it runs the same
|
|
531
|
+
* state machine, attribute planners and runtime (`accordion-runtime.ts`), on the canvas and on the live site.
|
|
532
|
+
*
|
|
533
|
+
* Container `box` role disclosure itemKey k1 · trait defaultOn (none | first)
|
|
534
|
+
* ├─ LinkedContainer `accordion-trigger` role disclosure.trigger → <button aria-expanded aria-controls>
|
|
535
|
+
* │ ├─ Text `body` (span) role disclosure.more "Read more" — hidden while open
|
|
536
|
+
* │ ├─ Text `body` (span) role disclosure.less "Read less" — shown only while open
|
|
537
|
+
* │ └─ Icon `icon` role disclosure.icon Item open → turns
|
|
538
|
+
* └─ Container `accordion-panel` role disclosure.panel inside a hidden="until-found" track
|
|
539
|
+
* └─ Text `body` the rest of the text
|
|
540
|
+
*
|
|
541
|
+
* The words swap through the ordinary Item open state (`trigger-on` → the root), so the label an author sees on
|
|
542
|
+
* the canvas is the one the visitor gets, with no script and nothing to break. The look is the accordion's own
|
|
543
|
+
* element styles (no `disclosure-*` contract: the boards draw none) — the header's ink, hover ink and focus ring;
|
|
544
|
+
* the panel's padding and muted ink — and the words are `body` text: the site's body type, with `color: inherit`, so
|
|
545
|
+
* the toggle's ink and its hover ink reach them.
|
|
546
|
+
*/
|
|
547
|
+
interface DisclosureWords {
|
|
548
|
+
more: string;
|
|
549
|
+
less: string;
|
|
550
|
+
body: string;
|
|
551
|
+
}
|
|
552
|
+
/** The words a fresh disclosure starts with — generic, the author's to replace. */
|
|
553
|
+
declare const DISCLOSURE_WORDS: Readonly<DisclosureWords>;
|
|
554
|
+
interface DisclosureOptions {
|
|
555
|
+
words?: Partial<DisclosureWords>;
|
|
556
|
+
/** Open on first render (default: closed). */
|
|
557
|
+
open?: boolean;
|
|
558
|
+
icon?: AccordionIcon;
|
|
559
|
+
}
|
|
560
|
+
/** A disclosure's one item key — its root IS its item. */
|
|
561
|
+
declare const DISCLOSURE_ITEM_KEY = "k1";
|
|
562
|
+
/** A fresh Disclosure: "Read more" opens the text below and reads "Read less" while it is open; closed by default. */
|
|
563
|
+
declare function buildDisclosureRecipe(create: CompositeNodeFactory, options?: DisclosureOptions): CompositeNode;
|
|
564
|
+
/** Behaviour ▸ Open by default (a disclosure: on or off). */
|
|
565
|
+
declare function disclosureOpenByDefault(root: CompositeNode): boolean;
|
|
411
566
|
|
|
412
567
|
/**
|
|
413
568
|
* BADGE + CHIP (composite T25; complex-components board 8). A Badge is a Container wearing
|
|
@@ -588,7 +743,11 @@ declare function setCardLinked(card: CompositeNode, on: boolean): boolean;
|
|
|
588
743
|
interface CompositeRoleSpec {
|
|
589
744
|
/** The role of the part's parent; null for a composite root. */
|
|
590
745
|
readonly parent: string | null;
|
|
746
|
+
/** The TYPE of the part's parent, for a part whose parent carries no role (a Slider's controls). */
|
|
747
|
+
readonly parentType?: string;
|
|
591
748
|
readonly locked?: boolean;
|
|
749
|
+
/** May be deleted, but never moved out of its parent (a Slider's controls work only as its direct children). */
|
|
750
|
+
readonly pinned?: boolean;
|
|
592
751
|
readonly part?: CardPart;
|
|
593
752
|
}
|
|
594
753
|
declare const COMPOSITE_ROLE_SPECS: Readonly<Record<string, CompositeRoleSpec>>;
|
|
@@ -603,17 +762,290 @@ declare enum StructureRefusal {
|
|
|
603
762
|
/** A locked part can only live directly inside its own parent role. */
|
|
604
763
|
LockedPlacement = "locked-placement"
|
|
605
764
|
}
|
|
606
|
-
interface RoleLike {
|
|
765
|
+
interface RoleLike$1 {
|
|
607
766
|
role?: string | null;
|
|
767
|
+
type?: string;
|
|
608
768
|
}
|
|
609
769
|
/**
|
|
610
770
|
* Why the structure guard refuses `edit` on `node`, or null when it is allowed. `ancestors` (Move only) =
|
|
611
771
|
* the new parent chain, root first, the direct parent last.
|
|
612
772
|
*/
|
|
613
|
-
declare function structureRefusal(node: RoleLike | null | undefined, edit: StructureEdit, ancestors?: ReadonlyArray<RoleLike>): StructureRefusal | null;
|
|
773
|
+
declare function structureRefusal(node: RoleLike$1 | null | undefined, edit: StructureEdit, ancestors?: ReadonlyArray<RoleLike$1>): StructureRefusal | null;
|
|
614
774
|
/** True when `node` is a locked part (shown with a lock and no delete in the layer tree). Deleting a whole
|
|
615
775
|
* composite is always allowed — only its locked parts are refused. */
|
|
616
|
-
declare function isLockedPart(node: RoleLike | null | undefined): boolean;
|
|
776
|
+
declare function isLockedPart(node: RoleLike$1 | null | undefined): boolean;
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* THE ACCESSIBLE CAROUSEL (CC3 — complex-components plan §7c, board 6; board 9 Q13). The Slider's controls are no
|
|
780
|
+
* longer drawn by Swiper: Previous, Next, Pause and Pagination are REAL nodes with roles — selectable on the canvas,
|
|
781
|
+
* in the layer tree and the breadcrumb, and styled on their own (R2) — handed to Swiper as its navigation and
|
|
782
|
+
* pagination elements.
|
|
783
|
+
*
|
|
784
|
+
* SliderContainer (.swiper)
|
|
785
|
+
* ├─ ButtonBlock `button-secondary` role slider.pause FIRST focus stop; present while Autoplay is on, locked
|
|
786
|
+
* ├─ ButtonBlock `button-secondary` role slider.prev › Icon caret (points the reading way in RTL)
|
|
787
|
+
* ├─ ButtonBlock `button-secondary` role slider.next › Icon caret
|
|
788
|
+
* ├─ (the slides — `.swiper-wrapper` › SliderSlide …)
|
|
789
|
+
* └─ Container role slider.pagination Swiper draws the dots (or "3 / 6") inside it
|
|
790
|
+
*
|
|
791
|
+
* The parts render INSIDE the `.swiper` element, never inside `.swiper-wrapper` (slider.md: a `.swiper-slide` must be
|
|
792
|
+
* the wrapper's direct child): the parts that come before the first slide in the tree render before the wrapper, the
|
|
793
|
+
* rest after it. By default they sit over the slides like Swiper's own controls (the shared CSS, iox-design.css, at
|
|
794
|
+
* zero specificity — a part's own styles win), so a saved slider migrated from Swiper-drawn controls keeps its look.
|
|
795
|
+
*
|
|
796
|
+
* The Bindings switches stay the source of truth: Navigation arrows ⇔ Previous + Next, Pagination ⇔ Pagination,
|
|
797
|
+
* Autoplay ⇔ Pause (WCAG 2.2.2 — "added while Autoplay is on, cannot be removed"). `syncSliderParts` is the one edit.
|
|
798
|
+
*/
|
|
799
|
+
declare enum SliderRole {
|
|
800
|
+
Pause = "slider.pause",
|
|
801
|
+
Prev = "slider.prev",
|
|
802
|
+
Next = "slider.next",
|
|
803
|
+
Pagination = "slider.pagination"
|
|
804
|
+
}
|
|
805
|
+
/** Parts in the order they are stamped: the pause control first (APG: the first focus stop), the dots last. */
|
|
806
|
+
declare const SLIDER_PART_ROLES: ReadonlyArray<SliderRole>;
|
|
807
|
+
declare const SLIDER_TYPE = "SliderContainer";
|
|
808
|
+
declare const SLIDE_TYPE = "SliderSlide";
|
|
809
|
+
/** The Bindings switches that own the parts. */
|
|
810
|
+
declare enum SliderFlag {
|
|
811
|
+
Navigation = "enableNavigation",
|
|
812
|
+
Pagination = "enablePagination",
|
|
813
|
+
Autoplay = "enableAutoplay"
|
|
814
|
+
}
|
|
815
|
+
/** The trait that names the carousel (Slider ▸ Accessibility ▸ Carousel name) — the A11y trait every named part uses. */
|
|
816
|
+
declare const SLIDER_NAME_TRAIT = "ariaLabel";
|
|
817
|
+
interface RoleLike {
|
|
818
|
+
role?: string | null;
|
|
819
|
+
type?: string;
|
|
820
|
+
}
|
|
821
|
+
declare function isSliderPart(node: RoleLike | null | undefined): boolean;
|
|
822
|
+
declare function isSlider(node: RoleLike | null | undefined): boolean;
|
|
823
|
+
/** The slider's own part playing `role` (a direct child), or undefined. */
|
|
824
|
+
declare function sliderPart<T extends RoleLike>(slider: {
|
|
825
|
+
children?: T[] | null;
|
|
826
|
+
}, role: SliderRole): T | undefined;
|
|
827
|
+
/** True when the slider's controls are parts (it was created or migrated in CC3) — Swiper then draws none of its own. */
|
|
828
|
+
declare function hasSliderParts(slider: {
|
|
829
|
+
children?: ReadonlyArray<RoleLike> | null;
|
|
830
|
+
}): boolean;
|
|
831
|
+
/** A slider's children split as they render: parts before the first slide, the slides (into `.swiper-wrapper`), and
|
|
832
|
+
* the parts after it. */
|
|
833
|
+
declare function splitSliderChildren<T extends RoleLike>(children: ReadonlyArray<T> | null | undefined): {
|
|
834
|
+
lead: T[];
|
|
835
|
+
slides: T[];
|
|
836
|
+
trail: T[];
|
|
837
|
+
};
|
|
838
|
+
/** The slides only (the template slide of a bound slider is `sliderSlides(children)[0]`). */
|
|
839
|
+
declare function sliderSlides<T extends RoleLike>(children: ReadonlyArray<T> | null | undefined): T[];
|
|
840
|
+
/** Each part's glyph (Phosphor) and its default accessible name. */
|
|
841
|
+
declare const SLIDER_PART_GLYPH: Readonly<Record<Exclude<SliderRole, SliderRole.Pagination>, string>>;
|
|
842
|
+
declare const SLIDER_PLAY_GLYPH = "ph-fill ph-play";
|
|
843
|
+
/**
|
|
844
|
+
* What a saved slider drew through Swiper before CC3, carried into its parts by the migration so it looks the same:
|
|
845
|
+
* bare chevrons in the author's arrow colour and size, the dots in the author's colour. Swiper's own default colour
|
|
846
|
+
* is its theme blue — what the live site drew, because the engine never applied the colour traits.
|
|
847
|
+
*/
|
|
848
|
+
interface LegacySliderLook {
|
|
849
|
+
navigationColor?: string;
|
|
850
|
+
navigationSize?: number;
|
|
851
|
+
paginationColor?: string;
|
|
852
|
+
}
|
|
853
|
+
declare const SWIPER_THEME_COLOR = "#007aff";
|
|
854
|
+
/** One part, from the recipe (board 6: `button-secondary` controls, token dots) or in a migrated slider's legacy look. */
|
|
855
|
+
declare function buildSliderPart(create: CompositeNodeFactory, role: SliderRole, legacy?: LegacySliderLook): CompositeNode;
|
|
856
|
+
/** The parts the slider's switches call for, in stamping order. */
|
|
857
|
+
declare function wantedSliderParts(slider: CompositeNode): SliderRole[];
|
|
858
|
+
interface SliderPartsChange {
|
|
859
|
+
added: CompositeNode[];
|
|
860
|
+
removed: CompositeNode[];
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Make the slider's parts match its switches — ONE edit (a palette switch, the migration, the composer). Missing
|
|
864
|
+
* parts are stamped from the recipe (or, `legacy`, in the migrated look) at their place: the pause control, Previous
|
|
865
|
+
* and Next before the first slide, the pagination after the last; parts whose switch is off are removed. Everything
|
|
866
|
+
* else (the slides, the author's edits to an existing part) is kept.
|
|
867
|
+
*/
|
|
868
|
+
declare function syncSliderParts(slider: CompositeNode, create: CompositeNodeFactory, legacy?: LegacySliderLook): SliderPartsChange;
|
|
869
|
+
/** True when a saved slider still relies on Swiper-drawn controls: a switch is on and no part exists yet. */
|
|
870
|
+
declare function needsSliderMigration(slider: CompositeNode | null | undefined): boolean;
|
|
871
|
+
/**
|
|
872
|
+
* The migration of a saved slider (board 9 Q13): its Swiper-drawn arrows, dots — and, when Autoplay is on, the pause
|
|
873
|
+
* control WCAG 2.2.2 requires — become parts, in the place and the colours Swiper drew them. Idempotent: a slider
|
|
874
|
+
* that already has parts is left alone. True when it changed.
|
|
875
|
+
*/
|
|
876
|
+
declare function migrateSliderControls(slider: CompositeNode, create: CompositeNodeFactory): boolean;
|
|
877
|
+
/**
|
|
878
|
+
* A switch flipped in the panel: on a slider still on Swiper-drawn controls, migrate it first (so its other controls
|
|
879
|
+
* keep their look), then stamp / remove the parts the new switch calls for. ONE edit.
|
|
880
|
+
*/
|
|
881
|
+
declare function setSliderFlag(slider: CompositeNode, flag: SliderFlag, on: boolean, create: CompositeNodeFactory): SliderPartsChange;
|
|
882
|
+
interface SliderWords {
|
|
883
|
+
stop: string;
|
|
884
|
+
start: string;
|
|
885
|
+
prev: string;
|
|
886
|
+
next: string;
|
|
887
|
+
carousel: string;
|
|
888
|
+
slide: string;
|
|
889
|
+
/** `{{index}}` and `{{slidesLength}}`, Swiper's placeholders. */
|
|
890
|
+
slideLabel: string;
|
|
891
|
+
goTo: string;
|
|
892
|
+
}
|
|
893
|
+
declare const SLIDER_WORDS: Readonly<Record<'en' | 'he', SliderWords>>;
|
|
894
|
+
declare function sliderWords(lang?: string | null): SliderWords;
|
|
895
|
+
/** The wrapper's live region (APG): silent while the slides move on their own, polite otherwise. */
|
|
896
|
+
declare function sliderLiveRegion(rotating: boolean): 'off' | 'polite';
|
|
897
|
+
/**
|
|
898
|
+
* The pause control's state (APG carousel): its NAME says what it will do ("Stop automatic slide show" while it
|
|
899
|
+
* rotates, "Start automatic slide show" when stopped). An author who named the control keeps the name, and the
|
|
900
|
+
* state is `aria-pressed` instead (pressed = stopped).
|
|
901
|
+
*/
|
|
902
|
+
declare function sliderPauseAttributes(rotating: boolean, words?: SliderWords, authorName?: string | null): Record<string, string>;
|
|
903
|
+
/** The pause control's glyph: pause while it rotates, play when stopped. */
|
|
904
|
+
declare function sliderPauseGlyph(rotating: boolean): string;
|
|
905
|
+
interface CarouselQuote {
|
|
906
|
+
quote: string;
|
|
907
|
+
who: string;
|
|
908
|
+
}
|
|
909
|
+
/** Board 6's sample quotes — PLACEHOLDERS: testimonials are facts the studio gives, never invented. */
|
|
910
|
+
declare const CAROUSEL_QUOTES: ReadonlyArray<CarouselQuote>;
|
|
911
|
+
interface CarouselOptions {
|
|
912
|
+
/** The carousel's accessible name (a `region` landmark). */
|
|
913
|
+
name?: string;
|
|
914
|
+
quotes?: ReadonlyArray<CarouselQuote>;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* The testimonial carousel (board 6): a named Slider, one quote per slide (each a `card`), rotating every 5s with its
|
|
918
|
+
* control parts — the pause control first, Previous · Next, the dots. ONE recipe for the composer and the builder.
|
|
919
|
+
*/
|
|
920
|
+
declare function buildCarouselRecipe(create: CompositeNodeFactory, options?: CarouselOptions): CompositeNode;
|
|
921
|
+
/** The slide a lightbox opens at for the clicked row (clamped to the slides there are). */
|
|
922
|
+
declare function slideIndexForRow(rowIndex: number, slideCount: number): number;
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* The accessible carousel's RUNTIME (CC3, board 6; closes vectoriox/iox-ui#13) — DOM only, over a running Swiper,
|
|
926
|
+
* ONE copy for the engine (both paths) and the admin's Preview. Swiper's A11y module gives the container
|
|
927
|
+
* `aria-roledescription="carousel"`, every slide `role=group` + "slide" + "n of m"; this adds what the APG
|
|
928
|
+
* carousel needs on top:
|
|
929
|
+
* - the PAUSE control (role `slider.pause`, rendered first): it stops rotation for good and starts it again; its
|
|
930
|
+
* name says what it will do, its glyph swaps;
|
|
931
|
+
* - rotation PAUSES while focus is anywhere inside (hover is Swiper's `pauseOnMouseEnter`) and resumes when it
|
|
932
|
+
* leaves — unless the visitor pressed pause;
|
|
933
|
+
* - the wrapper's live region is `off` while the slides move on their own and `polite` otherwise;
|
|
934
|
+
* - slides that are not in view are `inert` (and hidden from assistive technology), so Tab never lands in one.
|
|
935
|
+
* The builder's EDIT canvas never attaches it (no autoplay there, and a slide must stay clickable).
|
|
936
|
+
*/
|
|
937
|
+
/** The parts of the Swiper instance this runtime reads — a real Swiper, or a stub in a spec. */
|
|
938
|
+
interface CarouselSwiper {
|
|
939
|
+
el: HTMLElement;
|
|
940
|
+
wrapperEl: HTMLElement;
|
|
941
|
+
slides: HTMLElement[];
|
|
942
|
+
activeIndex: number;
|
|
943
|
+
destroyed?: boolean;
|
|
944
|
+
params?: {
|
|
945
|
+
slidesPerView?: number | 'auto';
|
|
946
|
+
autoplay?: {
|
|
947
|
+
pauseOnMouseEnter?: boolean;
|
|
948
|
+
} | boolean;
|
|
949
|
+
};
|
|
950
|
+
autoplay?: {
|
|
951
|
+
running: boolean;
|
|
952
|
+
paused?: boolean;
|
|
953
|
+
start(): void;
|
|
954
|
+
stop(): void;
|
|
955
|
+
pause(): void;
|
|
956
|
+
resume(): void;
|
|
957
|
+
};
|
|
958
|
+
on(event: string, handler: (...args: unknown[]) => void): void;
|
|
959
|
+
off(event: string, handler: (...args: unknown[]) => void): void;
|
|
960
|
+
}
|
|
961
|
+
interface CarouselA11yOptions {
|
|
962
|
+
words?: SliderWords;
|
|
963
|
+
}
|
|
964
|
+
/** The part of `role` that belongs to THIS slider (never one of a slider nested in a slide). */
|
|
965
|
+
declare function sliderPartElement(sliderEl: Element, role: SliderRole): HTMLElement | null;
|
|
966
|
+
declare class CarouselA11y {
|
|
967
|
+
private readonly swiper;
|
|
968
|
+
/** The visitor pressed pause: rotation stays stopped until they press it again. */
|
|
969
|
+
private stoppedByVisitor;
|
|
970
|
+
private focusInside;
|
|
971
|
+
/** The pointer is over the carousel and Swiper holds rotation for it (`pauseOnMouseEnter`). */
|
|
972
|
+
private hovering;
|
|
973
|
+
private readonly cleanups;
|
|
974
|
+
private readonly words;
|
|
975
|
+
private readonly pause;
|
|
976
|
+
private readonly authorName;
|
|
977
|
+
constructor(swiper: CarouselSwiper, options?: CarouselA11yOptions);
|
|
978
|
+
/** True while the slides move on their own: autoplay runs and nothing holds it — not focus inside, not the
|
|
979
|
+
* pointer over it. (Swiper's own `paused` also flips during every transition, so it is not read here.) */
|
|
980
|
+
get rotating(): boolean;
|
|
981
|
+
private get hoverPauses();
|
|
982
|
+
/** The pause control: stop rotation for good, or start it again. */
|
|
983
|
+
togglePause(): void;
|
|
984
|
+
destroy(): void;
|
|
985
|
+
private listen;
|
|
986
|
+
private onFocusIn;
|
|
987
|
+
private onFocusOut;
|
|
988
|
+
/** Re-state the carousel: the live region, the pause control, the slides out of view. */
|
|
989
|
+
sync(): void;
|
|
990
|
+
private syncHiddenSlides;
|
|
991
|
+
}
|
|
992
|
+
/** The carousel runtime attached to a slider element, if any. */
|
|
993
|
+
declare function carouselOf(el: Element | null | undefined): CarouselA11y | null;
|
|
994
|
+
/** Attach once per Swiper (a re-init gets a fresh runtime). */
|
|
995
|
+
declare function attachCarouselA11y(swiper: CarouselSwiper, options?: CarouselA11yOptions): CarouselA11y;
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* THE LIGHTBOX (CC3 — complex-components plan §7d, board 6). Not a component: a Dialog holding a Slider bound to the
|
|
999
|
+
* SAME source as the grid of thumbnails. The one new thing is `openDialog`'s "Open at the clicked item"
|
|
1000
|
+
* (`slideTo: 'row'`): a thumbnail in a repeater row opens the lightbox at ITS slide.
|
|
1001
|
+
*
|
|
1002
|
+
* Dialog `dialog` · centre · full viewport · Inverse scheme "Lightbox" (a free-standing Dialog: board A4)
|
|
1003
|
+
* ├─ ButtonBlock `button-ghost` "Close" › Icon × click → closeDialog
|
|
1004
|
+
* └─ SliderContainer one slide in view · keyboard · the source's rows
|
|
1005
|
+
* ├─ Previous · Next (slider.prev / slider.next, button-secondary) hidden on a phone (swipe)
|
|
1006
|
+
* ├─ SliderSlide › Image `media` (contain, keeps its alt) + Text `small` caption
|
|
1007
|
+
* └─ Pagination (slider.pagination) — the counter "3 / 6"
|
|
1008
|
+
*
|
|
1009
|
+
* Keyboard ← → are the Slider's Keyboard module; Esc and the focus trap are the `<dialog>`'s; focus returns to the
|
|
1010
|
+
* thumbnail that opened it (the dialog opener's own rule).
|
|
1011
|
+
*/
|
|
1012
|
+
declare const SLIDE_TO_ROW = "row";
|
|
1013
|
+
/** The attribute a renderer writes on every repeated row (the context-state provenance, both engine paths, the canvas). */
|
|
1014
|
+
declare const ROW_INDEX_ATTRIBUTE = "data-iox-row-idx";
|
|
1015
|
+
declare const LIGHTBOX_LABEL = "Lightbox";
|
|
1016
|
+
interface LightboxOptions {
|
|
1017
|
+
/** The list the slides come from (the grid's own source). Empty = three manual slides. */
|
|
1018
|
+
source?: string;
|
|
1019
|
+
sourcePath?: string;
|
|
1020
|
+
/** The row field each slide's image and caption read (`item` = the row itself, a bare URL). */
|
|
1021
|
+
imageField?: string;
|
|
1022
|
+
captionField?: string;
|
|
1023
|
+
/** The image's alt binding; '' = decorative (a bare URL row has no words of its own). */
|
|
1024
|
+
altField?: string;
|
|
1025
|
+
}
|
|
1026
|
+
/** On a phone the arrows give way to a swipe (board 6, "the arrows hide on touch-only widths"). */
|
|
1027
|
+
declare const LIGHTBOX_ARROWS_HIDE_AT = "mobile";
|
|
1028
|
+
/** A fresh lightbox: the Dialog, its Close part and the Slider (bound to `source`, or three manual slides). */
|
|
1029
|
+
declare function buildLightboxRecipe(create: CompositeNodeFactory, options?: LightboxOptions): CompositeNode;
|
|
1030
|
+
interface RepeatSource {
|
|
1031
|
+
source: string;
|
|
1032
|
+
path: string;
|
|
1033
|
+
}
|
|
1034
|
+
/** What a Repeater (its `source` binding) or a bound Slider (its `source` / `sourcePath` traits) repeats over. */
|
|
1035
|
+
declare function repeatSourceOf(node: CompositeNode | null | undefined): RepeatSource | null;
|
|
1036
|
+
declare function sameRepeatSource(a: RepeatSource | null, b: RepeatSource | null): boolean;
|
|
1037
|
+
/** The Slider a lightbox Dialog holds (the first one, depth first), or null. */
|
|
1038
|
+
declare function lightboxSliderOf(dialog: CompositeNode | null | undefined): CompositeNode | null;
|
|
1039
|
+
/** The repeated rows the element is in: the nearest Repeater or bound Slider among its ancestors (`path` = root → the
|
|
1040
|
+
* element, inclusive). */
|
|
1041
|
+
declare function rowSourceOf(path: ReadonlyArray<CompositeNode>): RepeatSource | null;
|
|
1042
|
+
/**
|
|
1043
|
+
* Interactions ▸ openDialog ▸ "Open at the clicked item" is offered only when it can work (board 9): the clicked
|
|
1044
|
+
* element sits in a repeater row AND the target Dialog holds a Slider bound to the same source.
|
|
1045
|
+
*/
|
|
1046
|
+
declare function canOpenAtClickedItem(ownerPath: ReadonlyArray<CompositeNode>, dialog: CompositeNode | null | undefined): boolean;
|
|
1047
|
+
/** The repeated row an element sits in (its row index), 0 when it is in none (the canvas' template row). */
|
|
1048
|
+
declare function rowIndexOf(el: Element | null | undefined): number;
|
|
617
1049
|
|
|
618
|
-
export { ACCORDION_BIND_PROP, ACCORDION_CONTENT_LIMIT, ACCORDION_DEFAULT_ONS, ACCORDION_ICONS, ACCORDION_ICON_GLYPH, ACCORDION_NEW_ITEM_WORDS, ACCORDION_WORDS, AccordionClass, AccordionDefaultOn, AccordionEditRefusal, AccordionIcon, AccordionKeyAction, AccordionRole, AccordionRuntime, BADGE_TONES, BADGE_TONE_ICONS, BadgeTone, CARD_LAYOUTS, CARD_LAYOUT_CUSTOM, CARD_PARTS, CARD_PART_ROLE, CARD_STACK_BREAKPOINT, CARD_WORDS, CHIP_ICON, CHIP_STYLE, COMPOSITE_ATTRIBUTE, COMPOSITE_ROLE_SPECS, CardLayout, CardPart, CardRole, CompositeBehaviourTrait, DEFAULT_ON_ATTRIBUTE, ITEM_KEY_ATTRIBUTE, ITEM_OFF_EVENT, ITEM_ON_EVENT, ITEM_OPEN_STATE, MULTIPLE_ATTRIBUTE, ON_ATTRIBUTE, ON_STATE, PILL_LABEL_STYLE, StructureEdit, StructureRefusal, UNTIL_FOUND, accordionAnswerOf, accordionBehaviour, accordionDomIds, accordionFocusIndex, accordionHeadingLevel, accordionItemAttributes, accordionItemLabel, accordionItemOf, accordionItemState, accordionItems, accordionKeyAction, accordionPanelAttributes, accordionPanelOf, accordionPartStyle, accordionQuestionOf, accordionRegionAttributes, accordionRemovalRefusal, accordionRootAttributes, accordionRootOf, accordionScope, accordionToContent, accordionToManual, accordionTrackAttributes, accordionTriggerAttributes, accordionTriggerOf, addAccordionItem, applyCardLayout, attachAccordionAt, attachAccordions, badgeStyleId, badgeToneOf, buildAccordionItem, buildAccordionRecipe, buildBadge, buildCardRecipe, buildChip, cardPartsOf, cardRootOf, cardTitleOf, clearLayerStyles, closestAccordion, closestAccordionItem, detachAccordion, detectAccordionIcon, detectCardLayout, domSafeKey, findByRole, initialAccordionOpen, isAccordionFromContent, isAccordionItemOn, isAccordionPart, isAccordionRoot, isCardLinked, isCardRoot, isLockedPart, isPillNode, itemOpenTriggerIds, moveAccordionItem, nextAccordionState, nextItemKey, onAccordionItemState, openAccordionItem, parentInComposite, pickAccordionAutoBinds, readLayerStyle, readProp, readStyle, removeFromComposite, renameAccordionItem, rowItemKey, serializeDomAttributes, setAccordionBehaviour, setAccordionIcon, setBadgeTone, setCardLinked, setCardPart, structureRefusal, walkComposite, writeLayerStyles, writeProp, writeStyles };
|
|
619
|
-
export type { AccordionAutoBinds, AccordionBehaviour, AccordionDomIds, AccordionItemState, AccordionOptions, AccordionRuntimeOptions, AccordionScope, AccordionWords, BaselineStyles, CardEditOptions, CardLayoutResult, CardLayoutState, CardOptions, CardPartChange, CardWords, CompositeBinding, CompositeLayer, CompositeNode, CompositeNodeFactory, CompositeNodeSpec, CompositeRoleSpec, CompositeTrait, ContentFieldLike, DomAttributes, PillOptions };
|
|
1050
|
+
export { ACCORDION_BIND_PROP, ACCORDION_CONTENT_LIMIT, ACCORDION_DEFAULT_ONS, ACCORDION_ICONS, ACCORDION_ICON_GLYPH, ACCORDION_NEW_ITEM_WORDS, ACCORDION_WORDS, AccordionClass, AccordionDefaultOn, AccordionEditRefusal, AccordionIcon, AccordionKeyAction, AccordionRole, AccordionRuntime, BADGE_TONES, BADGE_TONE_ICONS, BadgeTone, CARD_LAYOUTS, CARD_LAYOUT_CUSTOM, CARD_PARTS, CARD_PART_ROLE, CARD_STACK_BREAKPOINT, CARD_WORDS, CAROUSEL_QUOTES, CHIP_ICON, CHIP_STYLE, COMPOSITE_ATTRIBUTE, COMPOSITE_KIND_ROLES, COMPOSITE_ROLE_SPECS, CardLayout, CardPart, CardRole, CarouselA11y, CompositeBehaviourTrait, CompositeItemAction, CompositeKind, DEFAULT_ON_ATTRIBUTE, DISCLOSURE_ITEM_KEY, DISCLOSURE_WORDS, DisclosureRole, ITEM_KEY_ATTRIBUTE, ITEM_OFF_EVENT, ITEM_ON_EVENT, ITEM_OPEN_STATE, LIGHTBOX_ARROWS_HIDE_AT, LIGHTBOX_LABEL, MULTIPLE_ATTRIBUTE, NO_ELEMENT_STYLE, ON_ATTRIBUTE, ON_STATE, PILL_LABEL_STYLE, ROW_INDEX_ATTRIBUTE, SCOPE_ATTRIBUTE, SLIDER_NAME_TRAIT, SLIDER_PART_GLYPH, SLIDER_PART_ROLES, SLIDER_PLAY_GLYPH, SLIDER_TYPE, SLIDER_WORDS, SLIDE_TO_ROW, SLIDE_TYPE, SWIPER_THEME_COLOR, SliderFlag, SliderRole, StructureEdit, StructureRefusal, UNTIL_FOUND, accordionAnswerOf, accordionBehaviour, accordionDomIds, accordionFocusIndex, accordionHeadingLevel, accordionItemAttributes, accordionItemLabel, accordionItemOf, accordionItemState, accordionItems, accordionKeyAction, accordionPanelAttributes, accordionPanelOf, accordionPartStyle, accordionQuestionOf, accordionRegionAttributes, accordionRemovalRefusal, accordionRootAttributes, accordionRootOf, accordionRuntimeOf, accordionScope, accordionToContent, accordionToManual, accordionTrackAttributes, accordionTriggerAttributes, accordionTriggerOf, addAccordionItem, applyCardLayout, attachAccordionAt, attachAccordions, attachCarouselA11y, badgeStyleId, badgeToneOf, buildAccordionItem, buildAccordionRecipe, buildBadge, buildCardRecipe, buildCarouselRecipe, buildChip, buildCompositeIcon, buildDisclosureRecipe, buildLightboxRecipe, buildSliderPart, canOpenAtClickedItem, cardPartsOf, cardRootOf, cardTitleOf, carouselOf, clearLayerStyles, closeAccordionItem, closestAccordion, closestAccordionItem, compositeItemOf, compositeItems, compositeKindOfRole, compositeRootOf, compositeRowKeys, compositeScopeId, detachAccordion, detectAccordionIcon, detectCardLayout, disclosureOpenByDefault, domSafeKey, findByRole, hasLabelledRegion, hasSliderParts, initialAccordionOpen, isAccordionFromContent, isAccordionItemOn, isAccordionPart, isAccordionRoot, isCardLinked, isCardRoot, isCompositeItem, isCompositePanel, isCompositeRoot, isCompositeTrigger, isDisclosurePart, isDisclosureRoot, isLockedPart, isPillNode, isSlider, isSliderPart, itemOpenTriggerIds, lightboxSliderOf, makeCompositePart, migrateSliderControls, moveAccordionItem, needsSliderMigration, nextAccordionState, nextItemKey, onAccordionItemState, openAccordionItem, parentInComposite, pickAccordionAutoBinds, readLayerStyle, readProp, readStyle, removeFromComposite, renameAccordionItem, repeatSourceOf, rowIndexOf, rowItemKey, rowSourceOf, runCompositeItemAction, sameRepeatSource, serializeDomAttributes, setAccordionBehaviour, setAccordionIcon, setBadgeTone, setCardLinked, setCardPart, setSliderFlag, shouldScrollToItem, slideIndexForRow, sliderLiveRegion, sliderPart, sliderPartElement, sliderPauseAttributes, sliderPauseGlyph, sliderSlides, sliderWords, splitSliderChildren, structureRefusal, syncSliderParts, walkComposite, wantedSliderParts, writeLayerStyles, writeProp, writeStyles };
|
|
1051
|
+
export type { AccordionAutoBinds, AccordionBehaviour, AccordionDomIds, AccordionItemState, AccordionOptions, AccordionRuntimeOptions, AccordionScope, AccordionWords, BaselineStyles, CardEditOptions, CardLayoutResult, CardLayoutState, CardOptions, CardPartChange, CardWords, CarouselA11yOptions, CarouselOptions, CarouselQuote, CarouselSwiper, CompositeBinding, CompositeKindRoles, CompositeLayer, CompositeNode, CompositeNodeFactory, CompositeNodeSpec, CompositeRoleSpec, CompositeTrait, ContentFieldLike, DisclosureOptions, DisclosureWords, DomAttributes, LegacySliderLook, LightboxOptions, PillOptions, RepeatSource, SliderPartsChange, SliderWords };
|