@encorekit/web-sdk 2.2.1 → 2.4.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/README.md +66 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/preview.cjs +2 -0
- package/dist/cjs/preview.cjs.map +1 -0
- package/dist/cjs/react.cjs +1 -1
- package/dist/cjs/react.cjs.map +1 -1
- package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js +2 -0
- package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js.map +1 -0
- package/dist/esm/chunks/GiftsButton-B0lVB463.js +2 -0
- package/dist/esm/chunks/GiftsButton-B0lVB463.js.map +1 -0
- package/dist/esm/chunks/TriggerHost-CNTiNrTH.js +2 -0
- package/dist/esm/chunks/TriggerHost-CNTiNrTH.js.map +1 -0
- package/dist/esm/chunks/autoPops-CngtK_R0.js +2 -0
- package/dist/esm/chunks/autoPops-CngtK_R0.js.map +1 -0
- package/dist/esm/chunks/customClaim-B4uj-aOc.js +2 -0
- package/dist/esm/chunks/customClaim-B4uj-aOc.js.map +1 -0
- package/dist/esm/chunks/eligibility-BY7fL8Ve.js +2 -0
- package/dist/esm/chunks/eligibility-BY7fL8Ve.js.map +1 -0
- package/dist/esm/chunks/index-CaBSqauy.js +2 -0
- package/dist/esm/chunks/index-CaBSqauy.js.map +1 -0
- package/dist/esm/chunks/lookValues-B9z2VWpH.js +2 -0
- package/dist/esm/chunks/lookValues-B9z2VWpH.js.map +1 -0
- package/dist/esm/chunks/sduiView-Ds7QtFId.js +2 -0
- package/dist/esm/chunks/sduiView-Ds7QtFId.js.map +1 -0
- package/dist/esm/chunks/spot-DkKMLpB-.js +2 -0
- package/dist/esm/chunks/spot-DkKMLpB-.js.map +1 -0
- package/dist/esm/chunks/template-B9p4CbPD.js +2 -0
- package/dist/esm/chunks/template-B9p4CbPD.js.map +1 -0
- package/dist/esm/chunks/textSlots-BnwxUg9V.js +2 -0
- package/dist/esm/chunks/textSlots-BnwxUg9V.js.map +1 -0
- package/dist/esm/chunks/timers-Bva4yoGM.js +2 -0
- package/dist/esm/chunks/timers-Bva4yoGM.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/preview.js +2 -0
- package/dist/esm/preview.js.map +1 -0
- package/dist/esm/react.js +1 -1
- package/dist/esm/react.js.map +1 -1
- package/dist/umd/encore.min.js +1 -1
- package/dist/umd/encore.min.js.map +1 -1
- package/package.json +9 -1
- package/types/analytics/DiagnosticsOutbox.d.ts +1 -0
- package/types/analytics/DiagnosticsOutbox.d.ts.map +1 -1
- package/types/analytics/events.d.ts +108 -8
- package/types/analytics/events.d.ts.map +1 -1
- package/types/analytics/models.d.ts +2 -0
- package/types/analytics/models.d.ts.map +1 -1
- package/types/analytics/transport.d.ts +6 -0
- package/types/analytics/transport.d.ts.map +1 -1
- package/types/api/APIClient.d.ts +70 -33
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/contract.d.ts +4 -1
- package/types/api/contract.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +994 -17
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/api/models.d.ts +29 -8
- package/types/api/models.d.ts.map +1 -1
- package/types/api/offerBuilder.d.ts +51 -0
- package/types/api/offerBuilder.d.ts.map +1 -0
- package/types/core/Configuration.d.ts +9 -0
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts +145 -3
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/OfferManager.d.ts +27 -5
- package/types/core/OfferManager.d.ts.map +1 -1
- package/types/core/PlacementBuilder.d.ts +6 -1
- package/types/core/PlacementBuilder.d.ts.map +1 -1
- package/types/core/SignalManager.d.ts.map +1 -1
- package/types/core/StorageManager.d.ts +3 -2
- package/types/core/StorageManager.d.ts.map +1 -1
- package/types/core/StrictUnlockReconciler.d.ts +1 -1
- package/types/core/StrictUnlockReconciler.d.ts.map +1 -1
- package/types/core/claimHandle.d.ts +44 -0
- package/types/core/claimHandle.d.ts.map +1 -0
- package/types/core/claimLog.d.ts +102 -0
- package/types/core/claimLog.d.ts.map +1 -0
- package/types/core/claimRefusal.d.ts +3 -0
- package/types/core/claimRefusal.d.ts.map +1 -0
- package/types/core/claimScreenVariant.d.ts +3 -0
- package/types/core/claimScreenVariant.d.ts.map +1 -0
- package/types/core/claimStatusCheck.d.ts +62 -0
- package/types/core/claimStatusCheck.d.ts.map +1 -0
- package/types/core/giftVariant.d.ts +5 -0
- package/types/core/giftVariant.d.ts.map +1 -1
- package/types/core/hostDisplay.d.ts +9 -2
- package/types/core/hostDisplay.d.ts.map +1 -1
- package/types/core/sduiVariables.d.ts +20 -0
- package/types/core/sduiVariables.d.ts.map +1 -0
- package/types/core/strings.d.ts +114 -0
- package/types/core/strings.d.ts.map +1 -0
- package/types/core/unlockCode.d.ts +12 -2
- package/types/core/unlockCode.d.ts.map +1 -1
- package/types/core/userKeys.d.ts +7 -0
- package/types/core/userKeys.d.ts.map +1 -0
- package/types/core/version.d.ts +1 -1
- package/types/experiments/ExposureOutbox.d.ts +1 -0
- package/types/experiments/ExposureOutbox.d.ts.map +1 -1
- package/types/preview.d.ts +51 -0
- package/types/preview.d.ts.map +1 -0
- package/types/react.d.ts +53 -1
- package/types/react.d.ts.map +1 -1
- package/types/sdui/actions.d.ts +93 -0
- package/types/sdui/actions.d.ts.map +1 -0
- package/types/sdui/bindings.d.ts +63 -0
- package/types/sdui/bindings.d.ts.map +1 -0
- package/types/sdui/compile.d.ts +88 -0
- package/types/sdui/compile.d.ts.map +1 -0
- package/types/sdui/conditions.d.ts +22 -0
- package/types/sdui/conditions.d.ts.map +1 -0
- package/types/sdui/context.d.ts +132 -0
- package/types/sdui/context.d.ts.map +1 -0
- package/types/sdui/countdown.d.ts +31 -0
- package/types/sdui/countdown.d.ts.map +1 -0
- package/types/sdui/decode.d.ts +35 -0
- package/types/sdui/decode.d.ts.map +1 -0
- package/types/sdui/deps.d.ts +43 -0
- package/types/sdui/deps.d.ts.map +1 -0
- package/types/sdui/dominantColor.d.ts +24 -0
- package/types/sdui/dominantColor.d.ts.map +1 -0
- package/types/sdui/elements/confetti.d.ts +38 -0
- package/types/sdui/elements/confetti.d.ts.map +1 -0
- package/types/sdui/elements/content.d.ts +27 -0
- package/types/sdui/elements/content.d.ts.map +1 -0
- package/types/sdui/elements/interactive.d.ts +48 -0
- package/types/sdui/elements/interactive.d.ts.map +1 -0
- package/types/sdui/elements/layout.d.ts +41 -0
- package/types/sdui/elements/layout.d.ts.map +1 -0
- package/types/sdui/elements/marquee.d.ts +17 -0
- package/types/sdui/elements/marquee.d.ts.map +1 -0
- package/types/sdui/elements/progress.d.ts +10 -0
- package/types/sdui/elements/progress.d.ts.map +1 -0
- package/types/sdui/elements/shared.d.ts +138 -0
- package/types/sdui/elements/shared.d.ts.map +1 -0
- package/types/sdui/elements/symbols.d.ts +22 -0
- package/types/sdui/elements/symbols.d.ts.map +1 -0
- package/types/sdui/elements/triggerText.d.ts +55 -0
- package/types/sdui/elements/triggerText.d.ts.map +1 -0
- package/types/sdui/host.d.ts +274 -0
- package/types/sdui/host.d.ts.map +1 -0
- package/types/sdui/inlineMarkup.d.ts +22 -0
- package/types/sdui/inlineMarkup.d.ts.map +1 -0
- package/types/sdui/lookValues.d.ts +50 -0
- package/types/sdui/lookValues.d.ts.map +1 -0
- package/types/sdui/model.d.ts +130 -0
- package/types/sdui/model.d.ts.map +1 -0
- package/types/sdui/motion.d.ts +37 -0
- package/types/sdui/motion.d.ts.map +1 -0
- package/types/sdui/precheck.d.ts +94 -0
- package/types/sdui/precheck.d.ts.map +1 -0
- package/types/sdui/scrollMath.d.ts +32 -0
- package/types/sdui/scrollMath.d.ts.map +1 -0
- package/types/sdui/style.d.ts +99 -0
- package/types/sdui/style.d.ts.map +1 -0
- package/types/sdui/triggerKit.d.ts +24 -0
- package/types/sdui/triggerKit.d.ts.map +1 -0
- package/types/sdui/unrunnable.d.ts +11 -0
- package/types/sdui/unrunnable.d.ts.map +1 -0
- package/types/sdui/vocabulary.d.ts +119 -0
- package/types/sdui/vocabulary.d.ts.map +1 -0
- package/types/triggers/claimReminder/ClaimReminder.d.ts +65 -0
- package/types/triggers/claimReminder/ClaimReminder.d.ts.map +1 -0
- package/types/triggers/claimReminder/bindings.d.ts +40 -0
- package/types/triggers/claimReminder/bindings.d.ts.map +1 -0
- package/types/triggers/claimReminder/config.d.ts +56 -0
- package/types/triggers/claimReminder/config.d.ts.map +1 -0
- package/types/triggers/claimReminder/eligibility.d.ts +37 -0
- package/types/triggers/claimReminder/eligibility.d.ts.map +1 -0
- package/types/triggers/claimReminder/servedWindow.d.ts +15 -0
- package/types/triggers/claimReminder/servedWindow.d.ts.map +1 -0
- package/types/triggers/claimReminder/source.d.ts +29 -0
- package/types/triggers/claimReminder/source.d.ts.map +1 -0
- package/types/triggers/giftsButton/GiftsButton.d.ts +60 -0
- package/types/triggers/giftsButton/GiftsButton.d.ts.map +1 -0
- package/types/triggers/giftsButton/config.d.ts +53 -0
- package/types/triggers/giftsButton/config.d.ts.map +1 -0
- package/types/triggers/giftsButton/spot.d.ts +54 -0
- package/types/triggers/giftsButton/spot.d.ts.map +1 -0
- package/types/triggers/host/TriggerHost.d.ts +127 -0
- package/types/triggers/host/TriggerHost.d.ts.map +1 -0
- package/types/triggers/host/autoPops.d.ts +16 -0
- package/types/triggers/host/autoPops.d.ts.map +1 -0
- package/types/triggers/host/configCache.d.ts +29 -0
- package/types/triggers/host/configCache.d.ts.map +1 -0
- package/types/triggers/host/customClaim.d.ts +85 -0
- package/types/triggers/host/customClaim.d.ts.map +1 -0
- package/types/triggers/host/dismissStore.d.ts +37 -0
- package/types/triggers/host/dismissStore.d.ts.map +1 -0
- package/types/triggers/host/readThrottle.d.ts +15 -0
- package/types/triggers/host/readThrottle.d.ts.map +1 -0
- package/types/triggers/host/registry.d.ts +17 -0
- package/types/triggers/host/registry.d.ts.map +1 -0
- package/types/triggers/host/sduiView.d.ts +31 -0
- package/types/triggers/host/sduiView.d.ts.map +1 -0
- package/types/triggers/host/template.d.ts +28 -0
- package/types/triggers/host/template.d.ts.map +1 -0
- package/types/triggers/host/textSlots.d.ts +35 -0
- package/types/triggers/host/textSlots.d.ts.map +1 -0
- package/types/triggers/host/theme.d.ts +87 -0
- package/types/triggers/host/theme.d.ts.map +1 -0
- package/types/triggers/host/timers.d.ts +11 -0
- package/types/triggers/host/timers.d.ts.map +1 -0
- package/types/triggers/host/types.d.ts +278 -0
- package/types/triggers/host/types.d.ts.map +1 -0
- package/types/triggers/host/wire.d.ts +55 -0
- package/types/triggers/host/wire.d.ts.map +1 -0
- package/types/triggers/preview.d.ts +78 -0
- package/types/triggers/preview.d.ts.map +1 -0
- package/types/triggers/request.d.ts +53 -0
- package/types/triggers/request.d.ts.map +1 -0
- package/types/types.d.ts +420 -4
- package/types/types.d.ts.map +1 -1
- package/types/ui/ClaimScreen.d.ts +62 -0
- package/types/ui/ClaimScreen.d.ts.map +1 -0
- package/types/ui/CodeUnlock.d.ts +26 -2
- package/types/ui/CodeUnlock.d.ts.map +1 -1
- package/types/ui/GiftHero.d.ts.map +1 -1
- package/types/ui/GiftList.d.ts.map +1 -1
- package/types/ui/GiftPicker.d.ts.map +1 -1
- package/types/ui/GiftPickerHero.d.ts.map +1 -1
- package/types/ui/GiftReveal.d.ts.map +1 -1
- package/types/ui/GiftSheet.d.ts +5 -5
- package/types/ui/GiftSheet.d.ts.map +1 -1
- package/types/ui/GiftUnwrap.d.ts.map +1 -1
- package/types/ui/OfferCard.d.ts.map +1 -1
- package/types/ui/OfferCarousel.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +31 -6
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/PrimerScreen.d.ts +2 -0
- package/types/ui/PrimerScreen.d.ts.map +1 -1
- package/types/ui/RedemptionScreen.d.ts +5 -0
- package/types/ui/RedemptionScreen.d.ts.map +1 -1
- package/types/ui/RewardActions.d.ts.map +1 -1
- package/types/ui/RewardCard.d.ts.map +1 -1
- package/types/ui/SduiRewardSurface.d.ts +145 -0
- package/types/ui/SduiRewardSurface.d.ts.map +1 -0
- package/types/ui/Tooltip.d.ts.map +1 -1
- package/types/ui/brandComponents.d.ts.map +1 -1
- package/types/ui/brandTint.d.ts.map +1 -1
- package/types/ui/colorScheme.d.ts +15 -0
- package/types/ui/colorScheme.d.ts.map +1 -0
- package/types/ui/covered.d.ts +12 -0
- package/types/ui/covered.d.ts.map +1 -0
- package/types/ui/giftCategoryGroups.d.ts +13 -0
- package/types/ui/giftCategoryGroups.d.ts.map +1 -1
- package/types/ui/giftCopy.d.ts +14 -9
- package/types/ui/giftCopy.d.ts.map +1 -1
- package/types/ui/giftUnwrapCopy.d.ts.map +1 -1
- package/types/ui/imageURL.d.ts +44 -0
- package/types/ui/imageURL.d.ts.map +1 -0
- package/types/ui/impressionGate.d.ts +9 -0
- package/types/ui/impressionGate.d.ts.map +1 -1
- package/types/ui/offerBadge.d.ts.map +1 -1
- package/types/ui/rewardSurface.d.ts +11 -1
- package/types/ui/rewardSurface.d.ts.map +1 -1
- package/types/ui/sduiTheme.d.ts +48 -0
- package/types/ui/sduiTheme.d.ts.map +1 -0
- package/types/ui/sheetDetents.d.ts +28 -0
- package/types/ui/sheetDetents.d.ts.map +1 -0
- package/types/ui/styles.d.ts +11 -8
- package/types/ui/styles.d.ts.map +1 -1
- package/types/ui/termsLine.d.ts +3 -3
- package/types/ui/termsLine.d.ts.map +1 -1
- package/types/ui/toast.d.ts +11 -0
- package/types/ui/toast.d.ts.map +1 -0
- package/types/utils/logger.d.ts +10 -0
- package/types/utils/logger.d.ts.map +1 -1
- package/types/utils/text.d.ts +17 -0
- package/types/utils/text.d.ts.map +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The content elements: `text`, `systemImage`, `asyncImage`, `asyncVideo`,
|
|
3
|
+
* `appIcon`, `shape`, `gradient`, `empty`.
|
|
4
|
+
*
|
|
5
|
+
* `text` is the only one with real runtime behaviour, because it is the only
|
|
6
|
+
* one whose content can change without the tree changing. Everything else is
|
|
7
|
+
* static once compiled, which is why most of this file has no update site.
|
|
8
|
+
*/
|
|
9
|
+
import type { ElementRegistry } from "../compile";
|
|
10
|
+
import type { SduiTextDefaults } from "../context";
|
|
11
|
+
import type { RenderDeps, TriggerDeps } from "./shared";
|
|
12
|
+
/** Runtime copy the host owns, read fresh on every text update. */
|
|
13
|
+
export interface TextEnvironment {
|
|
14
|
+
readonly values: Readonly<Record<string, string>>;
|
|
15
|
+
readonly textMaps: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
16
|
+
readonly variables: Readonly<Record<string, string>>;
|
|
17
|
+
readonly defaults: SduiTextDefaults;
|
|
18
|
+
}
|
|
19
|
+
export interface ContentDeps extends RenderDeps {
|
|
20
|
+
/** Read on every update, so a host may swap copy without recompiling. */
|
|
21
|
+
textEnvironment(): TextEnvironment;
|
|
22
|
+
/** Trigger (inline) mounts only; a sheet has none and draws as before. */
|
|
23
|
+
readonly trigger?: TriggerDeps;
|
|
24
|
+
}
|
|
25
|
+
export declare function templateKeys(text: string | undefined): string[];
|
|
26
|
+
export declare function registerContentElements(registry: ElementRegistry, deps: ContentDeps): ElementRegistry;
|
|
27
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/sdui/elements/content.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AA0BnD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAMxD,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;CACrC;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,yEAAyE;IACzE,eAAe,IAAI,eAAe,CAAC;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;CAChC;AA2BD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAO/D;AA0DD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,WAAW,GAChB,eAAe,CA4gBjB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The interactive elements: `button`, `textField`, `toggle`, `slideButton`,
|
|
3
|
+
* `compactPageIndicator`, `confetti`.
|
|
4
|
+
*
|
|
5
|
+
* These are the elements the compile model exists for. Every one of them holds
|
|
6
|
+
* state the BROWSER owns rather than state the engine holds, so every one of
|
|
7
|
+
* them breaks under a renderer that rebuilds: a focused field loses its caret,
|
|
8
|
+
* a half-completed drag is dropped, a running confetti burst restarts.
|
|
9
|
+
*/
|
|
10
|
+
import type { ElementRegistry } from "../compile";
|
|
11
|
+
import type { TextEnvironment } from "./content";
|
|
12
|
+
import type { SduiEvaluationContext } from "../context";
|
|
13
|
+
import type { ActionHost } from "../actions";
|
|
14
|
+
import type { RenderDeps } from "./shared";
|
|
15
|
+
export interface InteractiveDeps extends RenderDeps {
|
|
16
|
+
readonly actionHost: ActionHost;
|
|
17
|
+
/** Latest context, for an event firing long after compile. */
|
|
18
|
+
currentContext(): SduiEvaluationContext;
|
|
19
|
+
/**
|
|
20
|
+
* Report a tap. Swift reports it FIRST in `handleAction`, before the switch
|
|
21
|
+
* (`SDUIElementRenderer.swift:634`), so a tap that changes state carries the
|
|
22
|
+
* state it was made IN, and an action this build does not recognise is still
|
|
23
|
+
* counted rather than vanishing.
|
|
24
|
+
*/
|
|
25
|
+
reportTap?(actionType: string, currentState: string): void;
|
|
26
|
+
/** False when the host switched claiming off. */
|
|
27
|
+
readonly claimEnabled?: boolean;
|
|
28
|
+
/** A text field's write: silent, and it clears `<key>Error`. */
|
|
29
|
+
editValue?(key: string, value: string): void;
|
|
30
|
+
/** The accessible name for a button that holds only this symbol. */
|
|
31
|
+
symbolLabel?(name: string): string | undefined;
|
|
32
|
+
/** Copy for a trigger button's `${...}` label and hint. */
|
|
33
|
+
textEnvironment?(): TextEnvironment;
|
|
34
|
+
}
|
|
35
|
+
export declare function registerInteractiveElements(registry: ElementRegistry, deps: InteractiveDeps): ElementRegistry;
|
|
36
|
+
/**
|
|
37
|
+
* The dots Swift's `CompactPageIndicator` draws: at most five, centred on the
|
|
38
|
+
* current page, the active one a capsule, and an edge dot at half size when more
|
|
39
|
+
* pages lie beyond it. Web drew one unsized span per offer, so eighteen offers
|
|
40
|
+
* made eighteen invisible dots.
|
|
41
|
+
*/
|
|
42
|
+
export declare function compactWindow(total: number, current: number): {
|
|
43
|
+
index: number;
|
|
44
|
+
active: boolean;
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
47
|
+
}[];
|
|
48
|
+
//# sourceMappingURL=interactive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../../../src/sdui/elements/interactive.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAAE,e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. Both change the shape of the DOM
|
|
6
|
+
* rather than the contents of one node, so both live in the compiler.
|
|
7
|
+
*
|
|
8
|
+
* Alignment is the one place SwiftUI and CSS genuinely differ. SwiftUI's
|
|
9
|
+
* `alignment` on a stack sets the CROSS axis, so `leading` on a `vStack` is
|
|
10
|
+
* horizontal and on an `hStack` is vertical. Mapping it to `align-items`
|
|
11
|
+
* without knowing the axis produces a layout that looks plausible and is wrong.
|
|
12
|
+
*/
|
|
13
|
+
import type { ElementRegistry } from "../compile";
|
|
14
|
+
import type { RenderDeps } from "./shared";
|
|
15
|
+
/**
|
|
16
|
+
* The mask for a scroller with more content before (`head`) or after (`tail`).
|
|
17
|
+
*
|
|
18
|
+
* Empty when there is nothing more either way, so a list that fits is drawn
|
|
19
|
+
* exactly as authored.
|
|
20
|
+
*/
|
|
21
|
+
export declare function edgeFadeMask(horizontal: boolean, head: boolean, tail: boolean): string;
|
|
22
|
+
/**
|
|
23
|
+
* Bind a carousel's position to the focused offer, both ways, as Swift's
|
|
24
|
+
* `SDUICarouselPositionModifier` does with `.scrollPosition(id:)`.
|
|
25
|
+
*
|
|
26
|
+
* Neither direction existed. Tapping a side card selected it but never brought
|
|
27
|
+
* it to the centre, and swiping moved the cards while the page indicator, the
|
|
28
|
+
* CTA and the selection all stayed on the first offer.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The margin that lets the first and last card reach the centre, as Swift's
|
|
32
|
+
* `SDUICenteredScrollMarginsModifier` derives it: `(viewport - card) / 2`.
|
|
33
|
+
*
|
|
34
|
+
* The template's `contentMargins` is only the fallback until both widths are
|
|
35
|
+
* known. It is sized for a phone (76 against 82 on a 375pt screen), so in the
|
|
36
|
+
* 720 desktop square the first card stopped 180px short of the centre, and sat
|
|
37
|
+
* there tilted by its own distance from it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function centringMargin(viewport: number, card: number): number | undefined;
|
|
40
|
+
export declare function registerLayoutElements(registry: ElementRegistry, deps: RenderDeps): ElementRegistry;
|
|
41
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/sdui/elements/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAalD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiQ3C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,GACZ,MAAM,CAOR;AAyND;;;;;;;GAOG;AACH;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAGpB;AA0VD,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,UAAU,GACf,eAAe,CAwOjB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* G4 `marquee` (trigger contract §3.4): content that scrolls on a loop.
|
|
3
|
+
*
|
|
4
|
+
* The items of `content` (a `forEach`) sit in a flex track along `axis` with
|
|
5
|
+
* `spacing`. Animating, the track holds the live content plus aria-hidden
|
|
6
|
+
* copies, enough to fill the viewport plus one cycle, and a generated
|
|
7
|
+
* `@keyframes` moves it one cycle per `duration`. Static (when `animateWhen`
|
|
8
|
+
* is false, reduce motion is on, or the host pauses it before it has moved), it
|
|
9
|
+
* holds the items once, centred on the axis. Paused after it has moved, it holds
|
|
10
|
+
* its place and resumes from there.
|
|
11
|
+
*
|
|
12
|
+
* Only a trigger mount decodes `marquee`, so only it ever reaches this.
|
|
13
|
+
*/
|
|
14
|
+
import type { ElementRegistry } from "../compile";
|
|
15
|
+
import type { RenderDeps } from "./shared";
|
|
16
|
+
export declare function registerMarqueeElement(registry: ElementRegistry, deps: RenderDeps): ElementRegistry;
|
|
17
|
+
//# sourceMappingURL=marquee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marquee.d.ts","sourceRoot":"","sources":["../../../src/sdui/elements/marquee.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAMlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiB3C,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,UAAU,GACf,eAAe,CAmKjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `progress` element (trigger vocabulary contract v1, §3.2): a capsule track
|
|
3
|
+
* with a capsule fill grown from the leading edge to the value's fraction.
|
|
4
|
+
*
|
|
5
|
+
* Registered for inline (trigger) mounts only; a sheet never decodes `progress`.
|
|
6
|
+
*/
|
|
7
|
+
import type { ElementRegistry } from "../compile";
|
|
8
|
+
import type { RenderDeps } from "./shared";
|
|
9
|
+
export declare function registerProgressElement(registry: ElementRegistry, deps: RenderDeps): ElementRegistry;
|
|
10
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/sdui/elements/progress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAO3C,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,UAAU,GACf,eAAe,CA4CjB"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every element renderer does with style, in one place.
|
|
3
|
+
*
|
|
4
|
+
* Applying CSS is only half of it. `planStyle` hands back structural intents
|
|
5
|
+
* that are not declarations: `overlay` and `backgroundElement` are child NODES,
|
|
6
|
+
* and both need a positioned wrapper. Doing that per renderer is how one of
|
|
7
|
+
* them ends up quietly unimplemented on a single element.
|
|
8
|
+
*/
|
|
9
|
+
import type { CompileServices, Rendered } from "../compile";
|
|
10
|
+
import type { SduiEvaluationContext } from "../context";
|
|
11
|
+
import type { SduiNode } from "../model";
|
|
12
|
+
import type { ColorResolver } from "../style";
|
|
13
|
+
import type { MotionSheet } from "../motion";
|
|
14
|
+
import type { TriggerKit } from "../triggerKit";
|
|
15
|
+
/** What a trigger (inline) mount adds; a sheet has none. */
|
|
16
|
+
export interface TriggerDeps {
|
|
17
|
+
/** Multiplies every text font size (`maxFontScale` already applied). */
|
|
18
|
+
readonly fontScale: number;
|
|
19
|
+
/** The trigger-only engine code, loaded with the trigger chunk (`triggerKit.ts`). */
|
|
20
|
+
readonly kit: TriggerKit;
|
|
21
|
+
/** This look's text `scaleGroup`s (one per mount): members shrink by one shared factor. */
|
|
22
|
+
readonly scaleGroups: InstanceType<TriggerKit["ScaleGroups"]>;
|
|
23
|
+
}
|
|
24
|
+
/** Injected once by the host, so renderers stay free of theme knowledge. */
|
|
25
|
+
export interface RenderDeps {
|
|
26
|
+
readonly color: ColorResolver;
|
|
27
|
+
/** Present only in a trigger (inline) mount, where the trigger vocabulary renders. */
|
|
28
|
+
readonly trigger?: TriggerDeps;
|
|
29
|
+
/** Trigger mounts only: where `style.loop` and `marquee` keyframes go. */
|
|
30
|
+
readonly motion?: MotionSheet;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a colour operand now, and again whenever a key it binds moves.
|
|
34
|
+
*
|
|
35
|
+
* A `binding` colour resolves at RENDER time. Only `fillColor` and
|
|
36
|
+
* `highlightColor` ever passed `values`, so every other colour in the vocabulary
|
|
37
|
+
* resolved once with none and painted its fallback for ever.
|
|
38
|
+
*/
|
|
39
|
+
export declare function bindColor(operand: unknown, ctx: SduiEvaluationContext, services: CompileServices, deps: RenderDeps, apply: (css: string | undefined) => void): void;
|
|
40
|
+
/** The layout properties a parent hands to a child. */
|
|
41
|
+
export type ChildFill = Partial<Record<"alignSelf" | "justifySelf" | "flexGrow" | "flexShrink" | "flexBasis" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "marginInline" | "width" | "height" | "zIndex" | "gridArea" | "pointerEvents" | "scrollSnapAlign", string>>;
|
|
42
|
+
/**
|
|
43
|
+
* Give a child a layout property, THROUGH any `display: contents` wrapper.
|
|
44
|
+
*
|
|
45
|
+
* A `conditional` and a `forEach` compile to a wrapper with no box, so a
|
|
46
|
+
* property set on one does nothing: the branch or the row is the real flex or
|
|
47
|
+
* grid item. The wrapper carries the intent instead, and re-applies it to
|
|
48
|
+
* whatever it mounts, because a conditional swaps branches and a `forEach`
|
|
49
|
+
* builds rows long after this runs.
|
|
50
|
+
*
|
|
51
|
+
* This is why the offer rows stayed three different widths after the stacks
|
|
52
|
+
* started handing out the fill: every one of them sits behind a `forEach` host.
|
|
53
|
+
*/
|
|
54
|
+
export declare function setChildFill(el: HTMLElement, fill: ChildFill): void;
|
|
55
|
+
export declare function readChildFill(el: HTMLElement): ChildFill;
|
|
56
|
+
/** Pass a host's carried fill to a node it has just mounted. */
|
|
57
|
+
export declare function inheritChildFill(host: HTMLElement, mounted: Node): void;
|
|
58
|
+
export declare function applyCss(el: HTMLElement, css: Readonly<Record<string, string>>): void;
|
|
59
|
+
/**
|
|
60
|
+
* Apply a node's style to `el`, mounting any structural intent.
|
|
61
|
+
*
|
|
62
|
+
* The overlay and background wrappers make `el` a positioning context. That is
|
|
63
|
+
* a real layout change, so it happens ONLY when an intent is present.
|
|
64
|
+
*/
|
|
65
|
+
export declare function applyNodeStyle(el: HTMLElement, node: SduiNode, ctx: SduiEvaluationContext, services: CompileServices, deps: RenderDeps): void;
|
|
66
|
+
/**
|
|
67
|
+
* Whether this subtree holds a `spacer` that is greedy on the HORIZONTAL axis.
|
|
68
|
+
*
|
|
69
|
+
* Only an `hStack`'s spacer is: in a `vStack` a spacer eats height instead. The
|
|
70
|
+
* greed propagates up, because the space a spacer claims is space its ancestors
|
|
71
|
+
* had to be offered first. An explicit `frame.width` stops it, since that is the
|
|
72
|
+
* author fixing the size.
|
|
73
|
+
*/
|
|
74
|
+
export declare function hasGreedySpacer(node: SduiNode, depth?: number): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* What this child asks to fill, looking THROUGH the wrappers that have no box.
|
|
77
|
+
*
|
|
78
|
+
* A `conditional` and a `forEach` compile to `display: contents`, so the node
|
|
79
|
+
* the parent sees carries no frame of its own: the intent is on the branch or
|
|
80
|
+
* the row template inside it. Reading only the wrapper's own style missed every
|
|
81
|
+
* one of them, which is most of this variant. The thank-you column asks for
|
|
82
|
+
* `maxHeight: .infinity` from inside a `conditional`, so it never filled the
|
|
83
|
+
* sheet and the spacers that should push the buttons to the bottom stayed flat.
|
|
84
|
+
*
|
|
85
|
+
* An explicit `frame.width` is the author fixing the size, so it wins.
|
|
86
|
+
*/
|
|
87
|
+
export declare function fillIntent(node: SduiNode, depth?: number): {
|
|
88
|
+
wide: boolean;
|
|
89
|
+
tall: boolean;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Elements whose own size is their single child's, so the intent is inside.
|
|
93
|
+
*
|
|
94
|
+
* The bottom sheet's dim backdrop is a `button` wrapping a rectangle that asks
|
|
95
|
+
* for both infinities, so reading only the button gave it no height and the
|
|
96
|
+
* screen behind the sheet was never dimmed.
|
|
97
|
+
*/
|
|
98
|
+
export declare const PASSTHROUGH: Set<string>;
|
|
99
|
+
/**
|
|
100
|
+
* Hand a single-content container's fill to the content it holds.
|
|
101
|
+
*
|
|
102
|
+
* Only a stack hands out fill, and a `button` is not a stack, so the sheet's
|
|
103
|
+
* dim backdrop stretched to the screen while the rectangle inside it stayed
|
|
104
|
+
* 0px high and nothing was dimmed. Applied only when the content asks, so an
|
|
105
|
+
* ordinary button keeps the layout it had.
|
|
106
|
+
*/
|
|
107
|
+
export declare function applyContentFill(el: HTMLElement, node: SduiNode): void;
|
|
108
|
+
/** A container element with its children compiled in order. */
|
|
109
|
+
export declare function container(tag: string, node: SduiNode, ctx: SduiEvaluationContext, services: CompileServices, deps: RenderDeps): {
|
|
110
|
+
el: HTMLElement;
|
|
111
|
+
rendered: Rendered;
|
|
112
|
+
};
|
|
113
|
+
declare const rec: (v: unknown) => Record<string, unknown> | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* A gradient stroke drawn OVER the element, as Swift's `strokeBorder` overlay
|
|
116
|
+
* is: the element keeps its background and its size. A masked child rather than
|
|
117
|
+
* a border, because CSS has no gradient border that follows a radius.
|
|
118
|
+
*/
|
|
119
|
+
declare function applyGradientBorder(el: HTMLElement, raw: Record<string, unknown>, deps: RenderDeps, ctx: SduiEvaluationContext): void;
|
|
120
|
+
/**
|
|
121
|
+
* Scroll-driven transforms.
|
|
122
|
+
*
|
|
123
|
+
* Compose hands Android `phase` and `centerDistance` from its scroll state; the
|
|
124
|
+
* DOM hands us neither, so both are computed from geometry here. The arithmetic
|
|
125
|
+
* itself is `scrollMath`, ported from Android, which until now was imported by
|
|
126
|
+
* nothing but its own test.
|
|
127
|
+
*/
|
|
128
|
+
declare function attachScrollEffects(el: HTMLElement, transition: Record<string, unknown>, faded: {
|
|
129
|
+
opacity: number;
|
|
130
|
+
}): () => void;
|
|
131
|
+
export { applyGradientBorder, attachScrollEffects, rec };
|
|
132
|
+
/**
|
|
133
|
+
* Collapse a `group` whose content renders nothing, and restore it when content
|
|
134
|
+
* returns. Swift styles a SwiftUI `Group`, whose modifiers vanish with an
|
|
135
|
+
* `EmptyView`, so an empty `maxHeight: infinity` group took no space on iOS.
|
|
136
|
+
*/
|
|
137
|
+
export declare function syncGroupVacancy(from: Element | null): void;
|
|
138
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"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AAI,EAAE,QAAQ,EACd,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,UAAU,GACf;IAAE,EAAE,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAUzC;AAKD,QAAA,MAAM,GAAG,GAAI,GAAG,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAGrC,CAAC;AAShB;;;;GAIG;AACH,iBAAS,mBAAmB,CAC1B,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,qBAAqB,GACzB,IAAI,CAsCN;AAyDD;;;;;;;GAOG;AACH,iBAAS,mBAAmB,CAC1B,EAAE,EAAE,WAAW,EACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACzB,MAAM,IAAI,CA8EZ;AAED,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,EAAE,CAAC;AAazD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAa3D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SF Symbols a variant may reference.
|
|
3
|
+
*
|
|
4
|
+
* SF Symbols are an Apple font with no web equivalent, so each one used by a
|
|
5
|
+
* shipped variant is drawn here as inline SVG. The set is exactly the eleven
|
|
6
|
+
* that appear across every checked-in variant, matching Android's
|
|
7
|
+
* `SduiSymbol.kt`, plus the three the trigger vocabulary adds: a deliberately
|
|
8
|
+
* small CLOSED set, because each addition is bytes in every host page.
|
|
9
|
+
*
|
|
10
|
+
* 🔴 THESE ARE APPROXIMATIONS AND NEED DESIGN SIGN-OFF. They are simple
|
|
11
|
+
* geometric stand-ins drawn to the same 24x24 box and stroke weight, not
|
|
12
|
+
* reproductions of Apple's artwork, which is not ours to copy. Parity of
|
|
13
|
+
* MEANING is the bar they meet today; parity of appearance is a design pass
|
|
14
|
+
* that has not happened. An unknown name renders nothing rather than a
|
|
15
|
+
* placeholder glyph, because a wrong icon reads as a bug and a missing one
|
|
16
|
+
* reads as an empty slot.
|
|
17
|
+
*/
|
|
18
|
+
/** Wire name to SVG body, drawn in a 0 0 24 24 box. */
|
|
19
|
+
export declare const SF_SYMBOLS: Readonly<Record<string, string>>;
|
|
20
|
+
/** An unknown symbol renders nothing. A wrong icon is worse than none. */
|
|
21
|
+
export declare function symbolSvg(name: unknown, size: number): string | undefined;
|
|
22
|
+
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../../src/sdui/elements/symbols.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAkBH,uDAAuD;AACvD,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BvD,CAAC;AAQF,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMzE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trigger-only text treatments: a ticking countdown and one-line shrink to fit.
|
|
3
|
+
* Part of the trigger kit (`../triggerKit.ts`), loaded with the trigger chunk on first
|
|
4
|
+
* mount, so a page that only shows sheets never downloads them.
|
|
5
|
+
*/
|
|
6
|
+
import type { SduiEvaluationContext } from "../context";
|
|
7
|
+
import type { Dependency } from "../deps";
|
|
8
|
+
import type { ContentDeps } from "./content";
|
|
9
|
+
/**
|
|
10
|
+
* A `text.countdown` (trigger mounts): the time left to a host time key, in the
|
|
11
|
+
* countdown's `format`, re-rendered whenever the clock or the keys move. The
|
|
12
|
+
* `units` are `${...}` text, resolved as any text is.
|
|
13
|
+
*/
|
|
14
|
+
export declare function countdownText(el: HTMLElement, countdown: Readonly<Record<string, unknown>>, deps: ContentDeps): {
|
|
15
|
+
node: Node;
|
|
16
|
+
deps: Dependency[];
|
|
17
|
+
update(c: SduiEvaluationContext): void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Trigger vocabulary `minimumScaleFactor` (0.5..1) on a one-line text: shrink the font
|
|
21
|
+
* to fit the width before truncating, never below the factor, then the line clamp
|
|
22
|
+
* ellipsizes. Measured with wrapping off, from the authored size each time, so a
|
|
23
|
+
* string that gets shorter grows back. Refits when the element's box changes size
|
|
24
|
+
* (e.g. once it is attached). Undefined when it does not apply.
|
|
25
|
+
*/
|
|
26
|
+
export declare function oneLineFit(el: HTMLElement, props: Readonly<Record<string, unknown>>): (() => void) | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The widest text a countdown format can show, so a scale group measures its countdown
|
|
29
|
+
* the same at every tick ("88:88" for hoursMinutes). Empty for a format whose width
|
|
30
|
+
* follows its words (`largestUnit`): that member is measured as shown.
|
|
31
|
+
*/
|
|
32
|
+
export declare function widestCountdownText(format: unknown): string;
|
|
33
|
+
/**
|
|
34
|
+
* What a countdown member is measured at: the format's widest sample, or the shown text with every
|
|
35
|
+
* digit at its widest when that is longer (a reminder window past 99 hours shows three hour digits,
|
|
36
|
+
* "719:59:59", which the two-digit sample would under-measure).
|
|
37
|
+
*/
|
|
38
|
+
export declare function countdownMeasureText(sample: string, shown: string | null): string;
|
|
39
|
+
/**
|
|
40
|
+
* Text `scaleGroup`s of one look: every member shrinks by one shared factor, the smallest
|
|
41
|
+
* any member needs to fit (each over its own lineLimit; a countdown at its widest text),
|
|
42
|
+
* never below the members' minimumScaleFactor, and keeps its own font size times that
|
|
43
|
+
* factor. A member that still does not fit truncates. Refits when a member's space or
|
|
44
|
+
* text changes.
|
|
45
|
+
*/
|
|
46
|
+
export declare class ScaleGroups {
|
|
47
|
+
#private;
|
|
48
|
+
/**
|
|
49
|
+
* Add `el` (its font size already set) to `group`. `countdownFormat`: the member is a
|
|
50
|
+
* countdown in that format. Returns the call that refits the whole group.
|
|
51
|
+
*/
|
|
52
|
+
join(group: string, el: HTMLElement, props: Readonly<Record<string, unknown>>, countdownFormat?: unknown): () => void;
|
|
53
|
+
fit(group: string): void;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=triggerText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggerText.d.ts","sourceRoot":"","sources":["../../../src/sdui/elements/triggerText.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAW7C;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,WAAW,EACf,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC5C,IAAI,EAAE,WAAW,GAChB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAC;IAAC,MAAM,CAAC,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAA;CAAE,CAuB5E;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACvC,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CA+B1B;AAqBD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAa3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EA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