@drawbridge/components 0.1.37 → 0.1.38
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/components/styles.css +68 -355
- package/dist/advertisement.js +15 -20
- package/dist/advertisement.mjs +15 -20
- package/dist/bridge/advertisements.js +4 -2
- package/dist/bridge/advertisements.mjs +5 -3
- package/dist/bridge/fields.js +89 -6
- package/dist/bridge/fields.mjs +89 -7
- package/dist/bridge/form-subdomain-agreement.js +165 -0
- package/dist/bridge/form-subdomain-agreement.mjs +132 -0
- package/dist/bridge/form-subdomain-embed.js +5 -1
- package/dist/bridge/form-subdomain-embed.mjs +5 -1
- package/dist/bridge/form-subdomain-header.js +21 -14
- package/dist/bridge/form-subdomain-header.mjs +20 -14
- package/dist/bridge/form-subdomain-issue.js +17 -8
- package/dist/bridge/form-subdomain-issue.mjs +17 -8
- package/dist/bridge/form-subdomain-missions.js +58 -52
- package/dist/bridge/form-subdomain-missions.mjs +60 -54
- package/dist/bridge/form-subdomain.js +223 -94
- package/dist/bridge/form-subdomain.mjs +222 -96
- package/dist/bridge/lib/entry.js +61 -6
- package/dist/bridge/lib/entry.mjs +51 -5
- package/dist/bridge/lib/order.js +23 -0
- package/dist/bridge/lib/order.mjs +20 -0
- package/dist/bridge/template-layout.js +5 -2
- package/dist/bridge/template-layout.mjs +6 -3
- package/dist/bridge/template-modal.js +82 -15
- package/dist/bridge/template-modal.mjs +83 -16
- package/dist/bridge/template-subdomain-gallery.js +126 -75
- package/dist/bridge/template-subdomain-gallery.mjs +122 -75
- package/dist/bridge/template-subdomain.js +16 -14
- package/dist/bridge/template-subdomain.mjs +17 -15
- package/dist/dashboard/avatar.js +5 -0
- package/dist/dashboard/avatar.mjs +5 -0
- package/dist/dashboard/campaign-form.js +1798 -0
- package/dist/dashboard/campaign-form.mjs +1769 -0
- package/dist/dashboard/card-affiliate.js +3 -2
- package/dist/dashboard/card-affiliate.mjs +3 -2
- package/dist/dashboard/card-campaign-agreement.js +172 -0
- package/dist/dashboard/card-campaign-agreement.mjs +139 -0
- package/dist/dashboard/card-campaign-switch.js +34 -9
- package/dist/dashboard/card-campaign-switch.mjs +32 -8
- package/dist/dashboard/card-order.js +6 -14
- package/dist/dashboard/card-order.mjs +6 -14
- package/dist/dashboard/card-section.js +69 -26
- package/dist/dashboard/card-section.mjs +65 -26
- package/dist/dashboard/card-shortcut.js +181 -0
- package/dist/dashboard/card-shortcut.mjs +152 -0
- package/dist/dashboard/card-tile.js +3 -35
- package/dist/dashboard/card-tile.mjs +3 -34
- package/dist/dashboard/document-blocks.js +305 -0
- package/dist/dashboard/document-blocks.mjs +270 -0
- package/dist/dashboard/drawer-subscription.js +52 -14
- package/dist/dashboard/drawer-subscription.mjs +52 -14
- package/dist/dashboard/drawer.js +20 -3
- package/dist/dashboard/drawer.mjs +21 -4
- package/dist/dashboard/dropdown.js +6 -2
- package/dist/dashboard/dropdown.mjs +6 -2
- package/dist/dashboard/form-admin-subscription-custom.js +72 -8
- package/dist/dashboard/form-admin-subscription-custom.mjs +72 -8
- package/dist/dashboard/form-ai.js +0 -148
- package/dist/dashboard/form-ai.mjs +1 -148
- package/dist/dashboard/form-filters-analytics.js +86 -38
- package/dist/dashboard/form-filters-analytics.mjs +85 -38
- package/dist/dashboard/form-organization-brand.js +30 -13
- package/dist/dashboard/form-organization-brand.mjs +30 -13
- package/dist/dashboard/form-organization-campaign-advertisement.js +38 -112
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +38 -112
- package/dist/dashboard/form-organization-campaign-advertisements.js +374 -0
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +345 -0
- package/dist/dashboard/form-organization-campaign-agreement.js +402 -210
- package/dist/dashboard/form-organization-campaign-agreement.mjs +398 -211
- package/dist/dashboard/form-organization-campaign-design.js +258 -0
- package/dist/dashboard/form-organization-campaign-design.mjs +223 -0
- package/dist/dashboard/form-organization-campaign-field-item.js +585 -0
- package/dist/dashboard/form-organization-campaign-field-item.mjs +552 -0
- package/dist/dashboard/form-organization-campaign-field-number.js +48 -7
- package/dist/dashboard/form-organization-campaign-field-number.mjs +48 -7
- package/dist/dashboard/form-organization-campaign-field-select.js +15 -4
- package/dist/dashboard/form-organization-campaign-field-select.mjs +15 -4
- package/dist/dashboard/form-organization-campaign-field-skill.js +359 -0
- package/dist/dashboard/form-organization-campaign-field-skill.mjs +330 -0
- package/dist/dashboard/form-organization-campaign-field-text.js +46 -6
- package/dist/dashboard/form-organization-campaign-field-text.mjs +46 -6
- package/dist/dashboard/form-organization-campaign-field-textarea.js +22 -13
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +22 -13
- package/dist/dashboard/form-organization-campaign-footer.js +178 -0
- package/dist/dashboard/form-organization-campaign-footer.mjs +149 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +2 -35
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +2 -35
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +4 -1
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +4 -1
- package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
- package/dist/dashboard/form-organization-campaign-page-preview.js +1 -2
- package/dist/dashboard/form-organization-campaign-page-preview.mjs +1 -2
- package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
- package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
- package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
- package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
- package/dist/dashboard/form-organization-campaign-page-slug.js +2 -3
- package/dist/dashboard/form-organization-campaign-page-slug.mjs +2 -3
- package/dist/dashboard/form-organization-campaign-page.js +168 -265
- package/dist/dashboard/form-organization-campaign-page.mjs +170 -266
- package/dist/dashboard/form-organization-campaign-section.js +125 -107
- package/dist/dashboard/form-organization-campaign-section.mjs +121 -107
- package/dist/dashboard/form-organization-campaign.js +119 -9
- package/dist/dashboard/form-organization-campaign.mjs +118 -9
- package/dist/dashboard/form-organization-file-frame.js +7 -1
- package/dist/dashboard/form-organization-file-frame.mjs +7 -1
- package/dist/dashboard/form-organization-workflow.js +587 -530
- package/dist/dashboard/form-organization-workflow.mjs +588 -531
- package/dist/dashboard/form-organization.js +22 -0
- package/dist/dashboard/form-organization.mjs +22 -0
- package/dist/dashboard/form-reposition.js +396 -0
- package/dist/dashboard/form-reposition.mjs +359 -0
- package/dist/dashboard/form-support.js +189 -0
- package/dist/dashboard/form-support.mjs +160 -0
- package/dist/dashboard/form-tests.js +683 -0
- package/dist/dashboard/form-tests.mjs +646 -0
- package/dist/dashboard/form-verify-prize.js +114 -34
- package/dist/dashboard/form-verify-prize.mjs +111 -34
- package/dist/dashboard/google.js +8 -1
- package/dist/dashboard/google.mjs +8 -1
- package/dist/dashboard/input-array.js +2 -0
- package/dist/dashboard/input-array.mjs +2 -0
- package/dist/dashboard/input-editor.js +17 -6
- package/dist/dashboard/input-editor.mjs +17 -6
- package/dist/dashboard/input-fields.js +287 -437
- package/dist/dashboard/input-fields.mjs +287 -436
- package/dist/dashboard/input-file.js +70 -2
- package/dist/dashboard/input-file.mjs +70 -2
- package/dist/dashboard/input-font.js +64 -55
- package/dist/dashboard/input-font.mjs +64 -55
- package/dist/dashboard/input-resource.js +4 -1
- package/dist/dashboard/input-resource.mjs +4 -1
- package/dist/dashboard/lib/ab-tests.js +130 -0
- package/dist/dashboard/lib/ab-tests.mjs +94 -0
- package/dist/dashboard/lib/features.js +1 -1
- package/dist/dashboard/lib/features.mjs +1 -1
- package/dist/dashboard/lib/focus.js +93 -0
- package/dist/dashboard/lib/focus.mjs +69 -0
- package/dist/dashboard/lib/form-page.js +203 -0
- package/dist/dashboard/lib/form-page.mjs +155 -0
- package/dist/dashboard/lib/item-list.js +0 -15
- package/dist/dashboard/lib/item-list.mjs +0 -14
- package/dist/dashboard/lib/rail.js +16 -17
- package/dist/dashboard/lib/rail.mjs +15 -16
- package/dist/dashboard/lib/sms.js +8 -2
- package/dist/dashboard/lib/sms.mjs +6 -1
- package/dist/dashboard/list-resource.js +2 -0
- package/dist/dashboard/list-resource.mjs +2 -0
- package/dist/dashboard/menu.js +54 -5
- package/dist/dashboard/menu.mjs +53 -5
- package/dist/dashboard/modal.js +19 -4
- package/dist/dashboard/modal.mjs +20 -5
- package/dist/dashboard/order-sections.js +4 -0
- package/dist/dashboard/order-sections.mjs +4 -0
- package/dist/dashboard/preview.js +838 -324
- package/dist/dashboard/preview.mjs +826 -324
- package/dist/dashboard/provider-ui.js +20 -12
- package/dist/dashboard/provider-ui.mjs +21 -13
- package/dist/dashboard/recharts.js +53 -28
- package/dist/dashboard/recharts.mjs +53 -28
- package/dist/dashboard/swatch.js +35 -0
- package/dist/dashboard/swatch.mjs +31 -0
- package/dist/dashboard/table-contacts.js +6 -10
- package/dist/dashboard/table-contacts.mjs +6 -10
- package/dist/dashboard/table.js +10 -3
- package/dist/dashboard/table.mjs +9 -3
- package/dist/dashboard/template-dashboard.js +12 -7
- package/dist/dashboard/template-dashboard.mjs +11 -7
- package/dist/dashboard/template-design.js +564 -0
- package/dist/dashboard/template-design.mjs +531 -0
- package/dist/dashboard/template-rail.js +198 -126
- package/dist/dashboard/template-rail.mjs +196 -125
- package/dist/dashboard/template-socket.js +0 -3
- package/dist/dashboard/template-socket.mjs +0 -3
- package/dist/dashboard/template-test-page.js +436 -0
- package/dist/dashboard/template-test-page.mjs +407 -0
- package/dist/dashboard/template-tests.js +141 -0
- package/dist/dashboard/template-tests.mjs +112 -0
- package/dist/dashboard/template-ui.js +20 -11
- package/dist/dashboard/template-ui.mjs +22 -13
- package/dist/dashboard/template-variant.js +185 -0
- package/dist/dashboard/template-variant.mjs +156 -0
- package/dist/icons/arrow-down-long.js +47 -0
- package/dist/icons/arrow-down-long.mjs +28 -0
- package/dist/icons/arrows-pointing-out.js +46 -0
- package/dist/icons/arrows-pointing-out.mjs +27 -0
- package/dist/icons/beaker.js +46 -0
- package/dist/icons/beaker.mjs +27 -0
- package/dist/icons/identification.js +46 -0
- package/dist/icons/identification.mjs +27 -0
- package/dist/icons/lifebuoy.js +46 -0
- package/dist/icons/lifebuoy.mjs +27 -0
- package/dist/icons/rectangle-group.js +46 -0
- package/dist/icons/rectangle-group.mjs +27 -0
- package/dist/icons/rectangle-stack.js +46 -0
- package/dist/icons/rectangle-stack.mjs +27 -0
- package/dist/icons/shopping-bag.js +46 -0
- package/dist/icons/shopping-bag.mjs +27 -0
- package/dist/icons/swatch.js +46 -0
- package/dist/icons/swatch.mjs +27 -0
- package/dist/icons/window.js +46 -0
- package/dist/icons/window.mjs +27 -0
- package/dist/icons/zoom-in.js +46 -0
- package/dist/icons/zoom-in.mjs +27 -0
- package/dist/input-answer.js +60 -0
- package/dist/input-answer.mjs +27 -0
- package/dist/input-checkbox.js +7 -1
- package/dist/input-checkbox.mjs +7 -1
- package/dist/input-name.js +3 -3
- package/dist/input-name.mjs +3 -3
- package/dist/input-select.js +3 -1
- package/dist/input-select.mjs +3 -1
- package/dist/provider-font.js +4 -3
- package/dist/provider-font.mjs +4 -3
- package/dist/shared/badge.js +15 -0
- package/dist/shared/badge.mjs +11 -0
- package/dist/shared/carousel.js +11 -7
- package/dist/shared/carousel.mjs +11 -7
- package/dist/shared/document-pieces.js +295 -0
- package/dist/shared/document-pieces.mjs +260 -0
- package/dist/shared/lib/campaign.js +3 -9
- package/dist/shared/lib/campaign.mjs +3 -9
- package/dist/shared/lib/helpers.js +24 -0
- package/dist/shared/lib/helpers.mjs +22 -0
- package/dist/shared/lib/video.js +6 -0
- package/dist/shared/lib/video.mjs +5 -0
- package/dist/shared/sortable.js +27 -10
- package/dist/shared/sortable.mjs +27 -10
- package/dist/shared/tabs.js +1 -1
- package/dist/shared/tabs.mjs +1 -1
- package/dist/video.js +127 -9
- package/dist/video.mjs +125 -11
- package/package.json +176 -20
- package/types/bridge/fields.d.ts +6 -1
- package/types/bridge/form-subdomain-agreement.d.ts +27 -0
- package/types/bridge/form-subdomain-missions.d.ts +2 -0
- package/types/bridge/form-subdomain.d.ts +62 -3
- package/types/bridge/lib/entry.d.ts +44 -7
- package/types/bridge/lib/order.d.ts +13 -2
- package/types/bridge/subdomain-content.d.ts +1 -0
- package/types/bridge/template-subdomain-gallery.d.ts +13 -1
- package/types/dashboard/campaign-form.d.ts +42 -0
- package/types/dashboard/card-campaign-agreement.d.ts +26 -0
- package/types/dashboard/card-campaign-switch.d.ts +20 -1
- package/types/dashboard/card-order.d.ts +2 -2
- package/types/dashboard/card-section.d.ts +9 -1
- package/types/dashboard/card-shortcut.d.ts +38 -0
- package/types/dashboard/card-tile.d.ts +4 -9
- package/types/dashboard/document-blocks.d.ts +14 -0
- package/types/dashboard/drawer.d.ts +3 -0
- package/types/dashboard/form-ai.d.ts +0 -17
- package/types/dashboard/form-organization-brand.d.ts +3 -0
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +15 -0
- package/types/dashboard/form-organization-campaign-agreement.d.ts +53 -10
- package/types/dashboard/form-organization-campaign-design.d.ts +46 -0
- package/types/dashboard/form-organization-campaign-field-item.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-number.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-field-select.d.ts +6 -1
- package/types/dashboard/form-organization-campaign-field-skill.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-text.d.ts +5 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-footer.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +2 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +9 -15
- package/types/dashboard/form-organization-campaign-section.d.ts +24 -8
- package/types/dashboard/form-organization-campaign.d.ts +3 -0
- package/types/dashboard/form-organization-workflow.d.ts +3 -0
- package/types/dashboard/form-organization.d.ts +2 -2
- package/types/dashboard/form-reposition.d.ts +29 -0
- package/types/dashboard/form-support.d.ts +14 -0
- package/types/dashboard/form-tests.d.ts +78 -0
- package/types/dashboard/form-verify-prize.d.ts +30 -3
- package/types/dashboard/input-editor.d.ts +9 -0
- package/types/dashboard/input-fields.d.ts +8 -5
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/input-resource.d.ts +1 -0
- package/types/dashboard/lib/ab-tests.d.ts +50 -0
- package/types/dashboard/lib/escape.d.ts +4 -0
- package/types/dashboard/lib/focus.d.ts +16 -0
- package/types/dashboard/lib/form-page.d.ts +25 -0
- package/types/dashboard/lib/item-list.d.ts +10 -5
- package/types/dashboard/lib/rail.d.ts +0 -1
- package/types/dashboard/lib/sms.d.ts +7 -0
- package/types/dashboard/modal.d.ts +3 -1
- package/types/dashboard/preview.d.ts +65 -10
- package/types/dashboard/recharts.d.ts +3 -0
- package/types/dashboard/swatch.d.ts +4 -0
- package/types/dashboard/template-dashboard.d.ts +3 -0
- package/types/dashboard/template-design.d.ts +30 -0
- package/types/dashboard/template-test-page.d.ts +69 -0
- package/types/dashboard/template-tests.d.ts +30 -0
- package/types/dashboard/template-variant.d.ts +18 -0
- package/types/icons/arrow-down-long.d.ts +5 -0
- package/types/icons/arrows-pointing-out.d.ts +5 -0
- package/types/icons/beaker.d.ts +5 -0
- package/types/icons/identification.d.ts +5 -0
- package/types/icons/lifebuoy.d.ts +5 -0
- package/types/icons/rectangle-group.d.ts +5 -0
- package/types/icons/rectangle-stack.d.ts +5 -0
- package/types/icons/shopping-bag.d.ts +5 -0
- package/types/icons/swatch.d.ts +5 -0
- package/types/icons/window.d.ts +5 -0
- package/types/icons/zoom-in.d.ts +5 -0
- package/types/input-answer.d.ts +15 -0
- package/types/input-select.d.ts +2 -0
- package/types/shared/button.d.ts +1 -1
- package/types/shared/document-pieces.d.ts +34 -0
- package/types/shared/lib/helpers.d.ts +22 -1
- package/types/shared/lib/motion.d.ts +2 -0
- package/types/shared/lib/video.d.ts +3 -0
- package/types/shared/sortable.d.ts +6 -0
- package/types/video.d.ts +18 -2
- package/dist/bridge/template-preview.js +0 -208
- package/dist/bridge/template-preview.mjs +0 -173
- package/dist/dashboard/device.js +0 -95
- package/dist/dashboard/device.mjs +0 -72
- package/dist/dashboard/form-organization-campaign-field-list.js +0 -425
- package/dist/dashboard/form-organization-campaign-field-list.mjs +0 -396
- package/dist/dashboard/item-row.js +0 -92
- package/dist/dashboard/item-row.mjs +0 -63
- package/types/bridge/template-preview.d.ts +0 -10
- package/types/dashboard/device.d.ts +0 -12
- package/types/dashboard/form-organization-campaign-field-list.d.ts +0 -36
- package/types/dashboard/item-row.d.ts +0 -25
|
@@ -10,6 +10,15 @@ const advertisementPreview = (values, options) => {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
const imageAlt = (file, description) => typeof description === "string" && description.trim() || (file == null ? void 0 : file.filename) || "";
|
|
13
|
+
const galleryItems = (gallery, described) => (gallery || []).filter(Boolean).map((item) => item.file && typeof item.file === "object" ? item : {
|
|
14
|
+
description: described == null ? void 0 : described[item.id],
|
|
15
|
+
file: item
|
|
16
|
+
});
|
|
17
|
+
const galleryValue = ({ description, file, position }) => ({
|
|
18
|
+
file: file == null ? void 0 : file.id,
|
|
19
|
+
...typeof description === "string" && description.trim() && { description },
|
|
20
|
+
...position && { position }
|
|
21
|
+
});
|
|
13
22
|
const bust = (href, version) => href ? href + (href.includes("?") ? "&" : "?") + "query=" + encodeURIComponent(version) : null;
|
|
14
23
|
const clickSummary = (click) => {
|
|
15
24
|
const parts = Object.entries(click || {}).map(([key, value]) => key + ": " + value);
|
|
@@ -281,6 +290,17 @@ const statuses = {
|
|
|
281
290
|
range: {
|
|
282
291
|
active: { text: "Active", type: "success" }
|
|
283
292
|
},
|
|
293
|
+
// @story ab-tests/list
|
|
294
|
+
// A test's status, which the api derives from its dates and its pause: Running
|
|
295
|
+
// green, Scheduled yellow, the rest gray. A deleted test is kept, and reads Deleted.
|
|
296
|
+
test: {
|
|
297
|
+
deleted: { text: "Deleted", type: "secondary" },
|
|
298
|
+
drafted: { text: "Drafted", type: "secondary" },
|
|
299
|
+
ended: { text: "Ended", type: "secondary" },
|
|
300
|
+
paused: { text: "Paused", type: "secondary" },
|
|
301
|
+
running: { text: "Running", type: "success" },
|
|
302
|
+
scheduled: { text: "Scheduled", type: "warning" }
|
|
303
|
+
},
|
|
284
304
|
subscription: {
|
|
285
305
|
active: { text: "Active", type: "success" },
|
|
286
306
|
canceled: { text: "Canceled", type: "error" },
|
|
@@ -355,6 +375,8 @@ export {
|
|
|
355
375
|
formatDateTime,
|
|
356
376
|
formatLast4,
|
|
357
377
|
formatUserName,
|
|
378
|
+
galleryItems,
|
|
379
|
+
galleryValue,
|
|
358
380
|
grid,
|
|
359
381
|
hasCapability,
|
|
360
382
|
hasConnection,
|
package/dist/shared/lib/video.js
CHANGED
|
@@ -19,6 +19,7 @@ var video_exports = {};
|
|
|
19
19
|
__export(video_exports, {
|
|
20
20
|
provideHls: () => provideHls,
|
|
21
21
|
startSeek: () => startSeek,
|
|
22
|
+
videoClock: () => videoClock,
|
|
22
23
|
videoErrorAction: () => videoErrorAction,
|
|
23
24
|
videoOverlay: () => videoOverlay
|
|
24
25
|
});
|
|
@@ -54,10 +55,15 @@ const startSeek = ({
|
|
|
54
55
|
if (reset) return 0;
|
|
55
56
|
return wasReset ? SHOWN_START : null;
|
|
56
57
|
};
|
|
58
|
+
const videoClock = (seconds) => {
|
|
59
|
+
const value = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;
|
|
60
|
+
return Math.floor(value / 60) + ":" + String(value % 60).padStart(2, "0");
|
|
61
|
+
};
|
|
57
62
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
63
|
0 && (module.exports = {
|
|
59
64
|
provideHls,
|
|
60
65
|
startSeek,
|
|
66
|
+
videoClock,
|
|
61
67
|
videoErrorAction,
|
|
62
68
|
videoOverlay
|
|
63
69
|
});
|
|
@@ -29,9 +29,14 @@ const startSeek = ({
|
|
|
29
29
|
if (reset) return 0;
|
|
30
30
|
return wasReset ? SHOWN_START : null;
|
|
31
31
|
};
|
|
32
|
+
const videoClock = (seconds) => {
|
|
33
|
+
const value = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;
|
|
34
|
+
return Math.floor(value / 60) + ":" + String(value % 60).padStart(2, "0");
|
|
35
|
+
};
|
|
32
36
|
export {
|
|
33
37
|
provideHls,
|
|
34
38
|
startSeek,
|
|
39
|
+
videoClock,
|
|
35
40
|
videoErrorAction,
|
|
36
41
|
videoOverlay
|
|
37
42
|
};
|
package/dist/shared/sortable.js
CHANGED
|
@@ -118,9 +118,15 @@ const SortableItem = ({
|
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
120
|
};
|
|
121
|
+
const toId = (index) => index + 1;
|
|
122
|
+
const toIndex = (id) => id - 1;
|
|
121
123
|
const Sortable = ({
|
|
122
124
|
classNameSortableItem,
|
|
123
125
|
disabled = false,
|
|
126
|
+
handleClassName = "flex items-center justify-center shrink-0 w-4 h-6 rounded cursor-move touch-none",
|
|
127
|
+
handleLabel,
|
|
128
|
+
onDragging = () => {
|
|
129
|
+
},
|
|
124
130
|
onSort = () => {
|
|
125
131
|
},
|
|
126
132
|
renderItem,
|
|
@@ -140,12 +146,15 @@ const Sortable = ({
|
|
|
140
146
|
}
|
|
141
147
|
)
|
|
142
148
|
);
|
|
143
|
-
const makeHandle = (props) => showHandle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
149
|
+
const makeHandle = (props, item) => showHandle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
144
150
|
"div",
|
|
145
151
|
{
|
|
146
152
|
...{
|
|
147
153
|
...props,
|
|
148
|
-
|
|
154
|
+
...handleLabel && item && {
|
|
155
|
+
"aria-label": handleLabel(item)
|
|
156
|
+
},
|
|
157
|
+
className: handleClassName
|
|
149
158
|
},
|
|
150
159
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
151
160
|
import_drag.default,
|
|
@@ -166,14 +175,22 @@ const Sortable = ({
|
|
|
166
175
|
} : void 0,
|
|
167
176
|
collisionDetection: import_core.closestCenter,
|
|
168
177
|
onDragStart: ({ active }) => {
|
|
169
|
-
setActiveId(active.id);
|
|
178
|
+
setActiveId(toIndex(active.id));
|
|
179
|
+
onDragging(true);
|
|
180
|
+
},
|
|
181
|
+
onDragCancel: () => {
|
|
182
|
+
setActiveId(null);
|
|
183
|
+
onDragging(false);
|
|
170
184
|
},
|
|
171
185
|
onDragEnd: ({ active, over }) => {
|
|
172
186
|
if (over && active.id !== over.id) {
|
|
173
|
-
const
|
|
174
|
-
|
|
187
|
+
const from = toIndex(active.id);
|
|
188
|
+
const to = toIndex(over.id);
|
|
189
|
+
const sorted = (0, import_sortable.arrayMove)(items, from, to);
|
|
190
|
+
onSort(sorted, { from, to });
|
|
175
191
|
}
|
|
176
192
|
setActiveId(null);
|
|
193
|
+
onDragging(false);
|
|
177
194
|
},
|
|
178
195
|
sensors
|
|
179
196
|
},
|
|
@@ -181,7 +198,7 @@ const Sortable = ({
|
|
|
181
198
|
import_sortable.SortableContext,
|
|
182
199
|
{
|
|
183
200
|
...{
|
|
184
|
-
items: items.map((_, i) => i),
|
|
201
|
+
items: items.map((_, i) => toId(i)),
|
|
185
202
|
strategy: import_sortable.verticalListSortingStrategy
|
|
186
203
|
},
|
|
187
204
|
children: [
|
|
@@ -191,9 +208,9 @@ const Sortable = ({
|
|
|
191
208
|
...{
|
|
192
209
|
as: sortableElement,
|
|
193
210
|
className: classNameSortableItem,
|
|
194
|
-
id: index
|
|
211
|
+
id: toId(index)
|
|
195
212
|
},
|
|
196
|
-
children: (dragHandleProps) => sortableElement ? renderItem(item, index, makeHandle(dragHandleProps)) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
213
|
+
children: (dragHandleProps) => sortableElement ? renderItem(item, index, makeHandle(dragHandleProps, item)) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
197
214
|
SortableItem,
|
|
198
215
|
{
|
|
199
216
|
...{
|
|
@@ -201,7 +218,7 @@ const Sortable = ({
|
|
|
201
218
|
className: classNameSortableItem
|
|
202
219
|
}
|
|
203
220
|
},
|
|
204
|
-
children: renderItem(item, index, makeHandle(dragHandleProps))
|
|
221
|
+
children: renderItem(item, index, makeHandle(dragHandleProps, item))
|
|
205
222
|
}
|
|
206
223
|
)
|
|
207
224
|
},
|
|
@@ -215,7 +232,7 @@ const Sortable = ({
|
|
|
215
232
|
className: classNameSortableItem
|
|
216
233
|
}
|
|
217
234
|
},
|
|
218
|
-
children: renderItem(items[activeId], activeId, makeHandle({}))
|
|
235
|
+
children: renderItem(items[activeId], activeId, makeHandle({}, items[activeId]))
|
|
219
236
|
}
|
|
220
237
|
) : null })
|
|
221
238
|
]
|
package/dist/shared/sortable.mjs
CHANGED
|
@@ -86,9 +86,15 @@ const SortableItem = ({
|
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
88
|
};
|
|
89
|
+
const toId = (index) => index + 1;
|
|
90
|
+
const toIndex = (id) => id - 1;
|
|
89
91
|
const Sortable = ({
|
|
90
92
|
classNameSortableItem,
|
|
91
93
|
disabled = false,
|
|
94
|
+
handleClassName = "flex items-center justify-center shrink-0 w-4 h-6 rounded cursor-move touch-none",
|
|
95
|
+
handleLabel,
|
|
96
|
+
onDragging = () => {
|
|
97
|
+
},
|
|
92
98
|
onSort = () => {
|
|
93
99
|
},
|
|
94
100
|
renderItem,
|
|
@@ -108,12 +114,15 @@ const Sortable = ({
|
|
|
108
114
|
}
|
|
109
115
|
)
|
|
110
116
|
);
|
|
111
|
-
const makeHandle = (props) => showHandle ? /* @__PURE__ */ jsx(
|
|
117
|
+
const makeHandle = (props, item) => showHandle ? /* @__PURE__ */ jsx(
|
|
112
118
|
"div",
|
|
113
119
|
{
|
|
114
120
|
...{
|
|
115
121
|
...props,
|
|
116
|
-
|
|
122
|
+
...handleLabel && item && {
|
|
123
|
+
"aria-label": handleLabel(item)
|
|
124
|
+
},
|
|
125
|
+
className: handleClassName
|
|
117
126
|
},
|
|
118
127
|
children: /* @__PURE__ */ jsx(
|
|
119
128
|
Drag,
|
|
@@ -134,14 +143,22 @@ const Sortable = ({
|
|
|
134
143
|
} : void 0,
|
|
135
144
|
collisionDetection: closestCenter,
|
|
136
145
|
onDragStart: ({ active }) => {
|
|
137
|
-
setActiveId(active.id);
|
|
146
|
+
setActiveId(toIndex(active.id));
|
|
147
|
+
onDragging(true);
|
|
148
|
+
},
|
|
149
|
+
onDragCancel: () => {
|
|
150
|
+
setActiveId(null);
|
|
151
|
+
onDragging(false);
|
|
138
152
|
},
|
|
139
153
|
onDragEnd: ({ active, over }) => {
|
|
140
154
|
if (over && active.id !== over.id) {
|
|
141
|
-
const
|
|
142
|
-
|
|
155
|
+
const from = toIndex(active.id);
|
|
156
|
+
const to = toIndex(over.id);
|
|
157
|
+
const sorted = arrayMove(items, from, to);
|
|
158
|
+
onSort(sorted, { from, to });
|
|
143
159
|
}
|
|
144
160
|
setActiveId(null);
|
|
161
|
+
onDragging(false);
|
|
145
162
|
},
|
|
146
163
|
sensors
|
|
147
164
|
},
|
|
@@ -149,7 +166,7 @@ const Sortable = ({
|
|
|
149
166
|
SortableContext,
|
|
150
167
|
{
|
|
151
168
|
...{
|
|
152
|
-
items: items.map((_, i) => i),
|
|
169
|
+
items: items.map((_, i) => toId(i)),
|
|
153
170
|
strategy: verticalListSortingStrategy
|
|
154
171
|
},
|
|
155
172
|
children: [
|
|
@@ -159,9 +176,9 @@ const Sortable = ({
|
|
|
159
176
|
...{
|
|
160
177
|
as: sortableElement,
|
|
161
178
|
className: classNameSortableItem,
|
|
162
|
-
id: index
|
|
179
|
+
id: toId(index)
|
|
163
180
|
},
|
|
164
|
-
children: (dragHandleProps) => sortableElement ? renderItem(item, index, makeHandle(dragHandleProps)) : /* @__PURE__ */ jsx(
|
|
181
|
+
children: (dragHandleProps) => sortableElement ? renderItem(item, index, makeHandle(dragHandleProps, item)) : /* @__PURE__ */ jsx(
|
|
165
182
|
SortableItem,
|
|
166
183
|
{
|
|
167
184
|
...{
|
|
@@ -169,7 +186,7 @@ const Sortable = ({
|
|
|
169
186
|
className: classNameSortableItem
|
|
170
187
|
}
|
|
171
188
|
},
|
|
172
|
-
children: renderItem(item, index, makeHandle(dragHandleProps))
|
|
189
|
+
children: renderItem(item, index, makeHandle(dragHandleProps, item))
|
|
173
190
|
}
|
|
174
191
|
)
|
|
175
192
|
},
|
|
@@ -183,7 +200,7 @@ const Sortable = ({
|
|
|
183
200
|
className: classNameSortableItem
|
|
184
201
|
}
|
|
185
202
|
},
|
|
186
|
-
children: renderItem(items[activeId], activeId, makeHandle({}))
|
|
203
|
+
children: renderItem(items[activeId], activeId, makeHandle({}, items[activeId]))
|
|
187
204
|
}
|
|
188
205
|
) : null })
|
|
189
206
|
]
|
package/dist/shared/tabs.js
CHANGED
|
@@ -85,7 +85,7 @@ const Tabs = ({
|
|
|
85
85
|
"span",
|
|
86
86
|
{
|
|
87
87
|
...{
|
|
88
|
-
className: "flex items-center justify-center w-full p-3 space-x-2 transform transition ease-in-out duration-200 " + (brand ? selected ? "opacity-70" : "" : selected ? "bg-
|
|
88
|
+
className: "flex items-center justify-center w-full p-3 space-x-2 transform transition ease-in-out duration-200 " + (brand ? selected ? "opacity-70" : "" : selected ? "bg-gray-light" : "bg-white"),
|
|
89
89
|
...brand && { style: { backgroundColor: brand.backgroundColor, color: brand.color } }
|
|
90
90
|
},
|
|
91
91
|
children: [
|
package/dist/shared/tabs.mjs
CHANGED
|
@@ -53,7 +53,7 @@ const Tabs = ({
|
|
|
53
53
|
"span",
|
|
54
54
|
{
|
|
55
55
|
...{
|
|
56
|
-
className: "flex items-center justify-center w-full p-3 space-x-2 transform transition ease-in-out duration-200 " + (brand ? selected ? "opacity-70" : "" : selected ? "bg-
|
|
56
|
+
className: "flex items-center justify-center w-full p-3 space-x-2 transform transition ease-in-out duration-200 " + (brand ? selected ? "opacity-70" : "" : selected ? "bg-gray-light" : "bg-white"),
|
|
57
57
|
...brand && { style: { backgroundColor: brand.backgroundColor, color: brand.color } }
|
|
58
58
|
},
|
|
59
59
|
children: [
|
package/dist/video.js
CHANGED
|
@@ -28,14 +28,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var video_exports = {};
|
|
30
30
|
__export(video_exports, {
|
|
31
|
+
Controls: () => Controls,
|
|
31
32
|
default: () => video_default
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(video_exports);
|
|
34
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_dynamic = __toESM(require("next/dynamic"));
|
|
36
37
|
var import_react = require("react");
|
|
38
|
+
var import_button = __toESM(require("./shared/button"));
|
|
39
|
+
var import_arrows_pointing_out = __toESM(require("./icons/arrows-pointing-out"));
|
|
37
40
|
var import_loader = __toESM(require("./icons/loader"));
|
|
41
|
+
var import_pause = __toESM(require("./icons/pause"));
|
|
42
|
+
var import_play = __toESM(require("./icons/play"));
|
|
38
43
|
var import_warning = __toESM(require("./icons/warning"));
|
|
44
|
+
var import_styles = require("./styles");
|
|
39
45
|
var import_video = require("./shared/lib/video");
|
|
40
46
|
const ReactPlayer = (0, import_dynamic.default)(
|
|
41
47
|
() => Promise.all([
|
|
@@ -47,6 +53,107 @@ const ReactPlayer = (0, import_dynamic.default)(
|
|
|
47
53
|
ssr: false
|
|
48
54
|
}
|
|
49
55
|
);
|
|
56
|
+
const Controls = ({ fullscreen = false, style, video }) => {
|
|
57
|
+
const [time, setTime] = (0, import_react.useState)(0);
|
|
58
|
+
const [duration, setDuration] = (0, import_react.useState)(0);
|
|
59
|
+
const [playing, setPlaying] = (0, import_react.useState)(false);
|
|
60
|
+
(0, import_react.useEffect)(
|
|
61
|
+
() => {
|
|
62
|
+
if (!video) return;
|
|
63
|
+
const sync = () => {
|
|
64
|
+
setTime(video.currentTime || 0);
|
|
65
|
+
setDuration(Number.isFinite(video.duration) ? video.duration : 0);
|
|
66
|
+
setPlaying(!video.paused);
|
|
67
|
+
};
|
|
68
|
+
const events = ["durationchange", "loadedmetadata", "pause", "play", "timeupdate"];
|
|
69
|
+
events.forEach((name) => video.addEventListener(name, sync));
|
|
70
|
+
sync();
|
|
71
|
+
return () => events.forEach((name) => video.removeEventListener(name, sync));
|
|
72
|
+
},
|
|
73
|
+
[video]
|
|
74
|
+
);
|
|
75
|
+
const played = duration ? time / duration * 100 : 0;
|
|
76
|
+
const rest = (0, import_styles.dotStyle)(style, false).backgroundColor;
|
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
...{
|
|
81
|
+
className: "flex items-center gap-3 py-2",
|
|
82
|
+
...style && {
|
|
83
|
+
style: {
|
|
84
|
+
color: (0, import_styles.buttonStyle)(style).backgroundColor
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
import_button.default,
|
|
91
|
+
{
|
|
92
|
+
...{
|
|
93
|
+
"aria-label": playing ? "Pause" : "Play",
|
|
94
|
+
disabled: !video,
|
|
95
|
+
icon: playing ? import_pause.default : import_play.default,
|
|
96
|
+
inline: true,
|
|
97
|
+
onClick: () => {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
return playing ? video == null ? void 0 : video.pause() : (_b = (_a = video == null ? void 0 : video.play()) == null ? void 0 : _a.catch) == null ? void 0 : _b.call(_a, () => {
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
variant: "link"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
107
|
+
"span",
|
|
108
|
+
{
|
|
109
|
+
...{
|
|
110
|
+
className: "text-sm tabular-nums shrink-0"
|
|
111
|
+
},
|
|
112
|
+
children: (0, import_video.videoClock)(time) + " / " + (0, import_video.videoClock)(duration)
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
"input",
|
|
117
|
+
{
|
|
118
|
+
...{
|
|
119
|
+
"aria-label": "Video timeline",
|
|
120
|
+
className: "controls-track w-full h-1 cursor-pointer appearance-none rounded-full",
|
|
121
|
+
disabled: !video,
|
|
122
|
+
max: duration || 0,
|
|
123
|
+
min: 0,
|
|
124
|
+
onChange: ({ target }) => {
|
|
125
|
+
if (video) video.currentTime = Number(target.value);
|
|
126
|
+
},
|
|
127
|
+
step: 0.01,
|
|
128
|
+
style: {
|
|
129
|
+
background: "linear-gradient( to right, currentColor " + played + "%, " + rest + " " + played + "% )"
|
|
130
|
+
},
|
|
131
|
+
type: "range",
|
|
132
|
+
value: time
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
fullscreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
import_button.default,
|
|
138
|
+
{
|
|
139
|
+
...{
|
|
140
|
+
"aria-label": "Full screen",
|
|
141
|
+
disabled: !video,
|
|
142
|
+
icon: import_arrows_pointing_out.default,
|
|
143
|
+
inline: true,
|
|
144
|
+
// iPhone Safari has no requestFullscreen on a video, only its own webkitEnterFullscreen.
|
|
145
|
+
onClick: () => {
|
|
146
|
+
var _a;
|
|
147
|
+
return (video == null ? void 0 : video.requestFullscreen) ? video.requestFullscreen() : (_a = video == null ? void 0 : video.webkitEnterFullscreen) == null ? void 0 : _a.call(video);
|
|
148
|
+
},
|
|
149
|
+
variant: "link"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
};
|
|
50
157
|
const DEFER_FALLBACK_MS = 5e3;
|
|
51
158
|
const Video = ({
|
|
52
159
|
className,
|
|
@@ -74,6 +181,8 @@ const Video = ({
|
|
|
74
181
|
const durationFired = (0, import_react.useRef)(false);
|
|
75
182
|
const errored = (0, import_react.useRef)(false);
|
|
76
183
|
const [player, setPlayer] = (0, import_react.useState)();
|
|
184
|
+
const bar = (0, import_react.isValidElement)(controls) ? controls : null;
|
|
185
|
+
const [element, setElement] = (0, import_react.useState)(null);
|
|
77
186
|
const [videoUrl, setVideoUrl] = (0, import_react.useState)(hls ? hls : mp4);
|
|
78
187
|
const [mountPlayer, setMountPlayer] = (0, import_react.useState)(!defer);
|
|
79
188
|
const [posterPainted, setPosterPainted] = (0, import_react.useState)(false);
|
|
@@ -130,7 +239,7 @@ const Video = ({
|
|
|
130
239
|
{
|
|
131
240
|
...{
|
|
132
241
|
className: "relative react-video",
|
|
133
|
-
controls,
|
|
242
|
+
controls: bar ? false : Boolean(controls),
|
|
134
243
|
config: {
|
|
135
244
|
file: {
|
|
136
245
|
attributes: {
|
|
@@ -188,16 +297,17 @@ const Video = ({
|
|
|
188
297
|
onReady: (instance) => {
|
|
189
298
|
var _a2;
|
|
190
299
|
setPlayer(instance.player);
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
300
|
+
const element2 = (_a2 = instance.getInternalPlayer) == null ? void 0 : _a2.call(instance);
|
|
301
|
+
if (bar && typeof (element2 == null ? void 0 : element2.play) === "function") setElement(element2);
|
|
302
|
+
if (!element2 || typeof element2.readyState !== "number") {
|
|
193
303
|
setVideoPaintable(true);
|
|
194
304
|
return;
|
|
195
305
|
}
|
|
196
|
-
if (
|
|
306
|
+
if (element2.readyState >= 2) {
|
|
197
307
|
setVideoPaintable(true);
|
|
198
308
|
return;
|
|
199
309
|
}
|
|
200
|
-
|
|
310
|
+
element2.addEventListener("loadeddata", () => setVideoPaintable(true), { once: true });
|
|
201
311
|
},
|
|
202
312
|
playing: Boolean(playing),
|
|
203
313
|
playsinline: true,
|
|
@@ -214,14 +324,14 @@ const Video = ({
|
|
|
214
324
|
"aria-hidden": true,
|
|
215
325
|
className: "absolute inset-0 w-full h-full object-cover pointer-events-none",
|
|
216
326
|
decoding: "async",
|
|
217
|
-
...priority ? {
|
|
327
|
+
...priority ? { fetchPriority: "high", loading: "eager" } : { loading: "lazy" },
|
|
218
328
|
onLoad: () => setPosterPainted(true),
|
|
219
329
|
// A cached poster can finish loading before React attaches
|
|
220
330
|
// onLoad, so check completeness on attach too — otherwise the
|
|
221
331
|
// exact case this optimises for (warm revisit) would fall
|
|
222
332
|
// through to the 5s fallback.
|
|
223
|
-
ref: (
|
|
224
|
-
if ((
|
|
333
|
+
ref: (element2) => {
|
|
334
|
+
if ((element2 == null ? void 0 : element2.complete) && element2.naturalWidth > 0) setPosterPainted(true);
|
|
225
335
|
},
|
|
226
336
|
src: poster
|
|
227
337
|
}
|
|
@@ -272,7 +382,7 @@ const Video = ({
|
|
|
272
382
|
}
|
|
273
383
|
)
|
|
274
384
|
] });
|
|
275
|
-
|
|
385
|
+
const box = className ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
276
386
|
"div",
|
|
277
387
|
{
|
|
278
388
|
...{
|
|
@@ -281,5 +391,13 @@ const Video = ({
|
|
|
281
391
|
children: inner
|
|
282
392
|
}
|
|
283
393
|
) : inner;
|
|
394
|
+
return bar ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
395
|
+
box,
|
|
396
|
+
(0, import_react.cloneElement)(bar, { video: element })
|
|
397
|
+
] }) : box;
|
|
284
398
|
};
|
|
285
399
|
var video_default = Video;
|
|
400
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
401
|
+
0 && (module.exports = {
|
|
402
|
+
Controls
|
|
403
|
+
});
|