@foldkit/ui 0.162.0-canary.bb557bf1e36e → 0.162.0-canary.fa519573715c
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/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/anchor/anchor.js +10 -1
- package/dist/disclosure/index.d.ts +1 -1
- package/dist/dragAndDrop/index.js +3 -3
- package/dist/test/apps/disabledButton.d.ts +4 -4
- package/dist/toast/index.d.ts +822 -43
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +77 -17
- package/dist/toast/public.d.ts +2 -2
- package/dist/toast/public.d.ts.map +1 -1
- package/dist/toast/public.js +1 -1
- package/dist/toast/schema.d.ts +145 -2
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +69 -2
- package/dist/toast/swipeTarget.d.ts +5 -0
- package/dist/toast/swipeTarget.d.ts.map +1 -0
- package/dist/toast/swipeTarget.js +18 -0
- package/dist/toast/test.d.ts +1 -1
- package/dist/toast/test.js +1 -1
- package/dist/toast/update.d.ts +726 -5
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +277 -62
- package/dist/tooltip/tooltip.d.ts +2 -2
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAgB,MAAM,QAAQ,CAAA;AAatE;mFACmF;AACnF,eAAO,MAAM,SAAS,0KAapB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;+DAC+D;AAC/D,eAAO,MAAM,OAAO;;;;;IAQlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,oGAAoG;AACpG,eAAO,MAAM,YAAY;;;;;;;;;;;;EAOvB,CAAA;AAEF,MAAM,M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AqB0B;AAC1B,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAsBF;;;;;;;;;;;;;;;;;;;;;;;gFAuBgF;AAChF,eAAO,MAAM,WAAW,YACb,OAAO,UACR,WAAW,KAClB,CAAC,MAAM,IAAI,CAkQb,CAAA"}
|
package/dist/anchor/anchor.js
CHANGED
|
@@ -136,8 +136,17 @@ export const anchorSetup = (element, config) => {
|
|
|
136
136
|
const root = element.getRootNode();
|
|
137
137
|
const inShadow = root instanceof ShadowRoot;
|
|
138
138
|
const owner = inShadow ? root : document;
|
|
139
|
+
if (!(element instanceof HTMLElement)) {
|
|
140
|
+
console.error('[@foldkit/ui] anchorSetup requires an HTML panel. The panel will not be positioned.');
|
|
141
|
+
return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
|
|
142
|
+
}
|
|
139
143
|
const button = owner.getElementById(config.buttonId);
|
|
140
|
-
if (
|
|
144
|
+
if (button === null) {
|
|
145
|
+
console.error(`[@foldkit/ui] anchorSetup could not find a trigger with id "${config.buttonId}". The panel will not be positioned.`);
|
|
146
|
+
return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
|
|
147
|
+
}
|
|
148
|
+
if (!(button instanceof HTMLElement)) {
|
|
149
|
+
console.error(`[@foldkit/ui] anchorSetup requires an HTML trigger with id "${config.buttonId}". The panel will not be positioned.`);
|
|
141
150
|
return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
|
|
142
151
|
}
|
|
143
152
|
const isPortal = config.anchor.portal ?? true;
|
|
@@ -30,7 +30,7 @@ export type DisclosureAttributes<Message> = Readonly<{
|
|
|
30
30
|
* disclosure opens. */
|
|
31
31
|
animatePanel: (content: Html, options?: AnimatePanelOptions) => Html;
|
|
32
32
|
}>;
|
|
33
|
-
/** Options for
|
|
33
|
+
/** Options for `DisclosureAttributes.animatePanel`.
|
|
34
34
|
*
|
|
35
35
|
* - `peek`: a CSS height the collapsed panel keeps, such as `'7.5em'` for
|
|
36
36
|
* five lines at a 1.5 leading. The visible content is an inert preview;
|
|
@@ -393,18 +393,18 @@ export const subscriptions = Subscription.make()(entry => (__foldkitBrandViewRes
|
|
|
393
393
|
dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Subscription.fromEventFilterMapPreventDefault({
|
|
394
394
|
target: document,
|
|
395
395
|
type: 'keydown',
|
|
396
|
-
|
|
396
|
+
filterMapEvent: event => {
|
|
397
397
|
// NOTE: the draggable's OnKeyDownPreventDefault calls preventDefault on
|
|
398
398
|
// the Space that activates keyboard drag. Skip it here so the same
|
|
399
399
|
// keypress doesn't also confirm the drop in the same tick.
|
|
400
400
|
if (event.defaultPrevented) {
|
|
401
|
-
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/dragAndDrop/index.js#
|
|
401
|
+
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/dragAndDrop/index.js#filterMapEvent");
|
|
402
402
|
}
|
|
403
403
|
return __foldkitBrandViewResult((Match.value(event.key).pipe(Match.withReturnType(), Match.when('Tab', () => __foldkitBrandViewResult((Option.some(Message.PressedArrowKey({
|
|
404
404
|
direction: event.shiftKey
|
|
405
405
|
? 'PreviousContainer'
|
|
406
406
|
: 'NextContainer',
|
|
407
|
-
}))), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Match.whenOr(' ', 'Enter', () => __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~51")), Match.orElse(key => __foldkitBrandViewResult((Option.map(arrowKeyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~52")))), "@foldkit/ui/dragAndDrop/index.js#
|
|
407
|
+
}))), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Match.whenOr(' ', 'Enter', () => __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~51")), Match.orElse(key => __foldkitBrandViewResult((Option.map(arrowKeyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~52")))), "@foldkit/ui/dragAndDrop/index.js#filterMapEvent");
|
|
408
408
|
},
|
|
409
409
|
}), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~54")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~3"),
|
|
410
410
|
}),
|
|
@@ -65,10 +65,6 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
65
65
|
} | {
|
|
66
66
|
readonly _tag: "GotDialogMessage";
|
|
67
67
|
readonly message: {
|
|
68
|
-
readonly _tag: "RequestedClose";
|
|
69
|
-
} | {
|
|
70
|
-
readonly _tag: "RequestedOpen";
|
|
71
|
-
} | {
|
|
72
68
|
readonly _tag: "CompletedCloseDialog";
|
|
73
69
|
} | {
|
|
74
70
|
readonly _tag: "CompletedReleaseDialogResources";
|
|
@@ -87,6 +83,10 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
87
83
|
} | {
|
|
88
84
|
readonly _tag: "Showed";
|
|
89
85
|
};
|
|
86
|
+
} | {
|
|
87
|
+
readonly _tag: "RequestedClose";
|
|
88
|
+
} | {
|
|
89
|
+
readonly _tag: "RequestedOpen";
|
|
90
90
|
} | {
|
|
91
91
|
readonly _tag: "SucceededAcquireResources";
|
|
92
92
|
} | {
|