@kanorio/elements 1.1.0 → 1.2.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 +4 -1
- package/dist/AudioPlayer-DKUAB5KE.js +2 -0
- package/dist/AudioPlayer-S7YF7A2E.js +2 -0
- package/dist/CustomerAccountPanel-DJKV7LT4.js +2 -0
- package/dist/CustomerAccountPanel-RWEHWBJY.js +2 -0
- package/dist/FormAddressField-C6VN7J6I.js +2 -0
- package/dist/FormAddressField-QR7ZCH77.js +2 -0
- package/dist/FormChoiceDropdown-SJXD26CC.js +2 -0
- package/dist/FormChoiceDropdown-U3NIOOHG.js +2 -0
- package/dist/FormFileField-LZDCXI2Z.js +2 -0
- package/dist/FormFileField-ONL4Q55V.js +2 -0
- package/dist/FormTaxIdField-K34MDUPW.js +2 -0
- package/dist/FormTaxIdField-XMK5WRQO.js +2 -0
- package/dist/KanorioAccount-EN3TM67X.js +2 -0
- package/dist/KanorioAccount-XGVSGVYN.js +2 -0
- package/dist/KanorioAnalytics-NEKTFQEE.js +2 -0
- package/dist/KanorioAnalytics-UMCUWQM7.js +2 -0
- package/dist/KanorioCurriculum-3QSCOHK7.js +2 -0
- package/dist/KanorioCurriculum-RUIGZ5X7.js +2 -0
- package/dist/KanorioForm-GUA5GEJY.js +2 -0
- package/dist/KanorioForm-KXV7D2TU.js +2 -0
- package/dist/KanorioLightbox-M72HNQQX.js +2 -0
- package/dist/KanorioLightbox-TQ3Q73TD.js +2 -0
- package/dist/KanorioLogin-5XFN3YEE.js +2 -0
- package/dist/KanorioLogin-AJHHVQGV.js +2 -0
- package/dist/KanorioMedia-ADKUDH5C.js +2 -0
- package/dist/KanorioMedia-DLBSXCKA.js +2 -0
- package/dist/KanorioReviews-42FZSXTI.js +2 -0
- package/dist/KanorioReviews-7LD5WKFG.js +2 -0
- package/dist/KanorioUnit-NWBX5DEI.js +2 -0
- package/dist/KanorioUnit-SIM3344J.js +2 -0
- package/dist/MediaPlayer-F43FPK4E.js +2 -0
- package/dist/MediaPlayer-JHFZFOOG.js +2 -0
- package/dist/{PDFViewerFull-KMUVT2BL.js → PDFViewerFull-CB44M7GW.js} +3 -3
- package/dist/{PDFViewerFull-FBLYNUDX.js → PDFViewerFull-INVHZL4V.js} +2 -2
- package/dist/VideoPlayer-FWZF4DQK.js +2 -0
- package/dist/VideoPlayer-LNS7XJ4C.js +2 -0
- package/dist/account.d.ts +165 -0
- package/dist/account.js +2 -0
- package/dist/analytics.d.ts +44 -0
- package/dist/analytics.js +2 -0
- package/dist/bot-protection.d.ts +297 -0
- package/dist/bot-protection.js +2 -0
- package/dist/chunk-2E6RCDAA.js +2 -0
- package/dist/chunk-2FSD3N7F.js +6 -0
- package/dist/chunk-2J5XQK4H.js +2 -0
- package/dist/chunk-2LOQXVFI.js +2 -0
- package/dist/chunk-2ONAW3CA.js +2 -0
- package/dist/chunk-33AQQY6T.js +69 -0
- package/dist/chunk-36YEGBKK.js +2 -0
- package/dist/chunk-4BBERZ6T.js +2 -0
- package/dist/chunk-4BEKWYEW.js +2 -0
- package/dist/chunk-4DPSNQEI.js +2 -0
- package/dist/chunk-4KA3HSRQ.js +2 -0
- package/dist/chunk-4MOCTNN7.js +2 -0
- package/dist/chunk-5AUWUK5R.js +2 -0
- package/dist/chunk-5G3PQI25.js +2 -0
- package/dist/chunk-5HWAL7VK.js +2 -0
- package/dist/chunk-63XJWMJG.js +2 -0
- package/dist/chunk-66XN5RR4.js +2 -0
- package/dist/chunk-6RZBXZFP.js +2 -0
- package/dist/chunk-763LNERD.js +2 -0
- package/dist/chunk-7XWBVRXP.js +15 -0
- package/dist/chunk-A4DPHHAP.js +42 -0
- package/dist/chunk-AF46NLXK.js +2 -0
- package/dist/chunk-AFNEGNVJ.js +2 -0
- package/dist/chunk-AQ6F6MIJ.js +2 -0
- package/dist/chunk-ARU5PTJV.js +2 -0
- package/dist/chunk-B7KLKVIM.js +2 -0
- package/dist/chunk-BGVTMWPN.js +2 -0
- package/dist/chunk-BKNL7ZCI.js +2 -0
- package/dist/chunk-BU7KUHZK.js +8 -0
- package/dist/chunk-C7HUM2EN.js +2 -0
- package/dist/chunk-CU2JJTXI.js +2 -0
- package/dist/{chunk-5U2SZE3H.js → chunk-CUQUEGX2.js} +2 -2
- package/dist/chunk-D7K3YCBR.js +2 -0
- package/dist/chunk-DLJDYXKL.js +2 -0
- package/dist/chunk-DTBRUBPG.js +2 -0
- package/dist/chunk-E77WGXYW.js +2 -0
- package/dist/chunk-EE4S6NRV.js +3 -0
- package/dist/chunk-ET57PWXC.js +2 -0
- package/dist/chunk-EZMTUAQX.js +2 -0
- package/dist/chunk-FFAWYDLJ.js +2 -0
- package/dist/chunk-FQCA2VGY.js +2 -0
- package/dist/chunk-FSY5GB5E.js +3 -0
- package/dist/chunk-G4U6BFZY.js +2 -0
- package/dist/chunk-GJY6AQIS.js +2 -0
- package/dist/chunk-GMW7AUSG.js +2 -0
- package/dist/chunk-GZCED6V3.js +2 -0
- package/dist/chunk-H2XQYT62.js +2 -0
- package/dist/chunk-H7VP4BYY.js +2 -0
- package/dist/chunk-HFYLTH5B.js +2 -0
- package/dist/chunk-IAXVJLJ3.js +2 -0
- package/dist/chunk-IXDKZO42.js +2 -0
- package/dist/chunk-J37D44SX.js +2 -0
- package/dist/chunk-JH5D6YJX.js +2 -0
- package/dist/chunk-JREL5347.js +2 -0
- package/dist/chunk-K2XZKV3Q.js +2 -0
- package/dist/chunk-K4VRRKYJ.js +2 -0
- package/dist/chunk-KBKDMTYF.js +2 -0
- package/dist/chunk-KDNGDR64.js +2 -0
- package/dist/chunk-KNNN5V3T.js +2 -0
- package/dist/chunk-LWKCGUHS.js +2 -0
- package/dist/chunk-LWRWKZBC.js +2 -0
- package/dist/chunk-LXNMHQFN.js +2 -0
- package/dist/chunk-MC63CLSM.js +2 -0
- package/dist/chunk-MIQK3T3Y.js +2 -0
- package/dist/chunk-MQ7PBFUM.js +4 -0
- package/dist/chunk-MWPRTK32.js +2 -0
- package/dist/chunk-MXGMJAWS.js +2 -0
- package/dist/chunk-N4BGAMWD.js +2 -0
- package/dist/chunk-N5PIQM4L.js +3 -0
- package/dist/chunk-NBDRYQZV.js +2 -0
- package/dist/chunk-NGRNPVON.js +2 -0
- package/dist/chunk-NSY72ZYX.js +15 -0
- package/dist/chunk-O2SYHUQF.js +2 -0
- package/dist/chunk-OIKRLEW6.js +2 -0
- package/dist/chunk-OTK4YNSG.js +2 -0
- package/dist/chunk-OU4IOHLN.js +15 -0
- package/dist/chunk-PR2NRUEI.js +2 -0
- package/dist/chunk-QGR3QAQB.js +3 -0
- package/dist/chunk-QOQQCCID.js +2 -0
- package/dist/chunk-RG5JA44V.js +2 -0
- package/dist/chunk-RKEHHJDU.js +2 -0
- package/dist/chunk-S2NFWI7C.js +69 -0
- package/dist/chunk-S7FE2XRA.js +2 -0
- package/dist/chunk-SUXTLVTX.js +2 -0
- package/dist/chunk-SVWEVSYJ.js +2 -0
- package/dist/chunk-TEUQV3AT.js +2 -0
- package/dist/chunk-U7H3W23Q.js +2 -0
- package/dist/chunk-U7KVGD47.js +2 -0
- package/dist/chunk-UIHBR4NU.js +3 -0
- package/dist/chunk-UM74DXPE.js +2 -0
- package/dist/chunk-VKSYPXNL.js +2 -0
- package/dist/chunk-VUTODQFX.js +2 -0
- package/dist/chunk-VYSRVTYI.js +2 -0
- package/dist/chunk-W32ZFOPN.js +2 -0
- package/dist/chunk-W63RJF6Q.js +2 -0
- package/dist/chunk-WM5S3YN5.js +2 -0
- package/dist/chunk-WP7UEAIB.js +2 -0
- package/dist/chunk-WXIUWMFR.js +2 -0
- package/dist/chunk-Z4A5NQWJ.js +2 -0
- package/dist/chunk-Z4OV6QHI.js +2 -0
- package/dist/curriculum.d.ts +20 -0
- package/dist/curriculum.js +2 -0
- package/dist/deliverables-BDS7WMBC.js +99 -0
- package/dist/deliverables-C5RD2ASE.js +131 -0
- package/dist/elements.css +1 -1
- package/dist/events-CJeBru-H.d.ts +11 -0
- package/dist/form.d.ts +775 -0
- package/dist/form.js +2 -0
- package/dist/forms-answers-address-7P6EVFY5.js +2 -0
- package/dist/forms-answers-address-IQV2Y56H.js +2 -0
- package/dist/forms-answers-phone-2VZ46OME.js +2 -0
- package/dist/forms-answers-phone-5PUB5WKD.js +2 -0
- package/dist/forms-answers-tax-id-D4GOUC6N.js +2 -0
- package/dist/forms-answers-tax-id-WJD7K3PG.js +2 -0
- package/dist/index.d.ts +17 -3045
- package/dist/index.js +1 -1
- package/dist/kanorio-elements.js +9 -73
- package/dist/lightbox-DEvsB5dB.d.ts +100 -0
- package/dist/lightbox.d.ts +5 -0
- package/dist/lightbox.js +2 -0
- package/dist/login.d.ts +14 -0
- package/dist/login.js +2 -0
- package/dist/media.d.ts +85 -0
- package/dist/media.js +2 -0
- package/dist/phone-input-Q5AV6KSW.js +2 -0
- package/dist/phone-input-T6QX2TDS.js +2 -0
- package/dist/provider-CMLzyAjJ.d.ts +1277 -0
- package/dist/provider.d.ts +4 -0
- package/dist/provider.js +2 -0
- package/dist/reviews.d.ts +42 -0
- package/dist/reviews.js +2 -0
- package/dist/unit.d.ts +118 -0
- package/dist/unit.js +2 -0
- package/dist/{vidstack-BmcqUMKx-XYI2YLUH.js → vidstack-BmcqUMKx-FXVV4FRB.js} +2 -2
- package/dist/{vidstack-GkTzay8D-PBE5ZIYA.js → vidstack-GkTzay8D-53C3FRCO.js} +2 -2
- package/dist/web-components.d.ts +13 -1
- package/dist/web-components.js +1 -1
- package/dist/wire-ofSodpi1.d.ts +176 -0
- package/package.json +46 -2
- package/dist/MediaPlayer-7IBSXL7Q.js +0 -2
- package/dist/MediaPlayer-HTXF4T2V.js +0 -2
- package/dist/chunk-2UVUNYL6.js +0 -2
- package/dist/chunk-3OGF7I4H.js +0 -2
- package/dist/chunk-5AWUTOK7.js +0 -2
- package/dist/chunk-DTDUK36B.js +0 -8
- package/dist/chunk-JZXJO62T.js +0 -15
- package/dist/chunk-LLHBSWTL.js +0 -2
- package/dist/chunk-NOCGHD2O.js +0 -2
- package/dist/chunk-S4ZA2INU.js +0 -415
- package/dist/chunk-TLBIYET7.js +0 -404
- package/dist/chunk-TLRFFLH4.js +0 -94
- package/dist/chunk-U3U5KVR6.js +0 -2
- package/dist/chunk-UBMXRFSK.js +0 -4
- package/dist/deliverables-FBCRGMTB.js +0 -93
- package/dist/deliverables-FMKPDHJH.js +0 -92
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { K as KanorioConfig, a as KanorioContextValue, b as KanorioProvider, c as KanorioSiteBrand, d as KanorioSiteMeta, e as KanorioTheme, T as TOKEN_CHANGE_EVENT, f as brandCss, g as clearSiteMetaCache, l as loadElementsMessages, h as loadSiteMeta, u as useKanorio, i as useSiteMeta } from './provider-CMLzyAjJ.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@kanorio/sdk';
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{KanorioProvider,TOKEN_CHANGE_EVENT,brandCss,clearSiteMetaCache,loadElementsMessages,loadSiteMeta,useKanorio,useSiteMeta}from"./chunk-MIQK3T3Y.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{KanorioProvider,TOKEN_CHANGE_EVENT,brandCss,clearSiteMetaCache,loadElementsMessages,loadSiteMeta,useKanorio,useSiteMeta};
|
|
2
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { K as KanorioConfig } from './provider-CMLzyAjJ.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@kanorio/sdk';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Of the shared settings (`KanorioConfig`, also read from the surrounding provider) the list uses `siteUrl` and `timeZone` (the date
|
|
8
|
+
* of each review). `locale`, `theme`, `brand` and `token` have no effect: the list is plain markup with your own text.
|
|
9
|
+
*/
|
|
10
|
+
interface KanorioReviewsProps extends KanorioConfig {
|
|
11
|
+
/** `product:<id>` */
|
|
12
|
+
target: string;
|
|
13
|
+
/** Reviews per page; 20 by default */
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
/** Text of the "load more" button; no pagination when omitted */
|
|
16
|
+
loadMoreLabel?: string;
|
|
17
|
+
/** Text of the "verified purchase" badge; not shown when omitted */
|
|
18
|
+
verifiedLabel?: string;
|
|
19
|
+
/** Heading of the merchant's reply; replies are not shown when omitted */
|
|
20
|
+
replyLabel?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* List of approved reviews. It only fetches the data and renders minimal structure; styling is left to the host page: every element
|
|
25
|
+
* has `data-kanorio-*` attributes to select on, and there are no Kanorio classes, theme or brand (the same with or without a provider).
|
|
26
|
+
*/
|
|
27
|
+
declare function KanorioReviews({ target, pageSize, loadMoreLabel, verifiedLabel, replyLabel, className, siteUrl: siteUrlProp, timeZone: timeZoneProp }: KanorioReviewsProps): react_jsx_runtime.JSX.Element | null;
|
|
28
|
+
/** Of the shared settings (`KanorioConfig`) the summary uses `siteUrl` only: it is plain markup with your own text */
|
|
29
|
+
interface KanorioRatingProps extends KanorioConfig {
|
|
30
|
+
/** `product:<id>` */
|
|
31
|
+
target: string;
|
|
32
|
+
/** Text template for the count, with `{count}` replaced; only the number is shown when omitted */
|
|
33
|
+
countLabel?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Star rating summary. Reads the Delivery API's `/api/v1/reviews/summary` and renders nothing when the owner hides it (turned off or below the threshold).
|
|
38
|
+
* Plain markup with `data-kanorio-*` attributes for the host page's stylesheet, like `KanorioReviews`.
|
|
39
|
+
*/
|
|
40
|
+
declare function KanorioRating({ target, countLabel, className, siteUrl: siteUrlProp }: KanorioRatingProps): react_jsx_runtime.JSX.Element | null;
|
|
41
|
+
|
|
42
|
+
export { KanorioRating, type KanorioRatingProps, KanorioReviews, type KanorioReviewsProps };
|
package/dist/reviews.js
ADDED
package/dist/unit.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { CustomerContentClientLike } from '@kanorio/sdk';
|
|
3
|
+
import { C as CustomerDeliverableTree } from './wire-ofSodpi1.js';
|
|
4
|
+
import { K as KanorioConfig, V as VisitorMessages } from './provider-CMLzyAjJ.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
interface DeliverablePlayerLabels {
|
|
8
|
+
locked: string;
|
|
9
|
+
/** Blocked by sequential completion: {title} is the unit to complete first */
|
|
10
|
+
lockedBy: string;
|
|
11
|
+
preview: string;
|
|
12
|
+
unlocksAt: string;
|
|
13
|
+
open: string;
|
|
14
|
+
download: string;
|
|
15
|
+
completed: string;
|
|
16
|
+
/** Completion button for units that are not audio or video */
|
|
17
|
+
markComplete: string;
|
|
18
|
+
/** Units that do not count toward completion (optional) */
|
|
19
|
+
optional: string;
|
|
20
|
+
continueLearning: string;
|
|
21
|
+
start: string;
|
|
22
|
+
nextUnit: string;
|
|
23
|
+
previousUnit: string;
|
|
24
|
+
progress: string;
|
|
25
|
+
unitsCount: string;
|
|
26
|
+
loadError: string;
|
|
27
|
+
noUnits: string;
|
|
28
|
+
/** Quiz */
|
|
29
|
+
quizSubmit: string;
|
|
30
|
+
quizScore: string;
|
|
31
|
+
quizPassed: string;
|
|
32
|
+
quizFailed: string;
|
|
33
|
+
quizAttemptsLeft: string;
|
|
34
|
+
quizNoAttempts: string;
|
|
35
|
+
quizRetry: string;
|
|
36
|
+
quizPassingScore: string;
|
|
37
|
+
quizNotReady: string;
|
|
38
|
+
quizSelectAll: string;
|
|
39
|
+
quizCorrectCount: string;
|
|
40
|
+
quizPracticeHint: string;
|
|
41
|
+
quizPracticeAgain: string;
|
|
42
|
+
quizAcceptedAnswers: string;
|
|
43
|
+
quizTextPlaceholder: string;
|
|
44
|
+
quizNumericPlaceholder: string;
|
|
45
|
+
quizCorrectMark: string;
|
|
46
|
+
quizWrongMark: string;
|
|
47
|
+
/** Completion certificate download */
|
|
48
|
+
certificateDownload: string;
|
|
49
|
+
/** Autoplay the next unit when audio or video ends (the learner's own preference) */
|
|
50
|
+
autoplayNext: string;
|
|
51
|
+
/** Primary button: mark complete and go to the next unit (units that are not audio or video) */
|
|
52
|
+
completeAndContinue: string;
|
|
53
|
+
/** Note next to the button when the next unit is still locked (sequential completion) */
|
|
54
|
+
completeToContinue: string;
|
|
55
|
+
outline: string;
|
|
56
|
+
showOutline: string;
|
|
57
|
+
hideOutline: string;
|
|
58
|
+
closeOutline: string;
|
|
59
|
+
/** Settings above the outline (autoplay) */
|
|
60
|
+
settings: string;
|
|
61
|
+
minutes: string;
|
|
62
|
+
pages: string;
|
|
63
|
+
/** The unit has neither a file nor text */
|
|
64
|
+
unitEmpty: string;
|
|
65
|
+
retry: string;
|
|
66
|
+
/** Marks, in the outline, the unit the learner left off at */
|
|
67
|
+
lastViewed: string;
|
|
68
|
+
courseCompletedTitle: string;
|
|
69
|
+
courseCompletedOn: string;
|
|
70
|
+
keepBrowsing: string;
|
|
71
|
+
/** Heading of the unit's attachments */
|
|
72
|
+
attachments: string;
|
|
73
|
+
/** Accessible name of an attachment's download button */
|
|
74
|
+
downloadFile: string;
|
|
75
|
+
transcript: string;
|
|
76
|
+
transcriptShow: string;
|
|
77
|
+
transcriptHide: string;
|
|
78
|
+
transcriptSearch: string;
|
|
79
|
+
transcriptMatches: string;
|
|
80
|
+
transcriptNoResults: string;
|
|
81
|
+
transcriptDownload: string;
|
|
82
|
+
transcriptLanguage: string;
|
|
83
|
+
transcriptFollow: string;
|
|
84
|
+
transcriptAutoGenerated: string;
|
|
85
|
+
transcriptAutoTranslated: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface KanorioUnitProps extends KanorioConfig {
|
|
89
|
+
/** Deliverable id (from the Customer API's `GET /deliverables` or the Management API's `deliverables.list`) */
|
|
90
|
+
deliverable: string;
|
|
91
|
+
/** Initial unit id; resumes where the customer left off when omitted */
|
|
92
|
+
unit?: string | null;
|
|
93
|
+
/** Called when the unit changes (to sync the URL, for example) */
|
|
94
|
+
onUnitChange?: (unitId: string) => void;
|
|
95
|
+
/** Called after progress is reported (including when the deliverable was just completed) */
|
|
96
|
+
/** Progress event: `coveredPercent` is the share of this audio or video unit that was watched (0 to 100); null for other units or without a duration */
|
|
97
|
+
onProgress?: (event: {
|
|
98
|
+
unitId: string;
|
|
99
|
+
percent: number;
|
|
100
|
+
completed: boolean;
|
|
101
|
+
deliverableJustCompleted: boolean;
|
|
102
|
+
coveredPercent: number | null;
|
|
103
|
+
}) => void;
|
|
104
|
+
/** Shown when signed out (for example `<KanorioLogin>`); a default notice when omitted */
|
|
105
|
+
renderUnauthenticated?: () => React.ReactNode;
|
|
106
|
+
/**
|
|
107
|
+
* For hosted sites: a tree already fetched on the server and their own content client (BFF cookie), so the Customer API is not called.
|
|
108
|
+
* Both must be given to take effect; omit on headless sites, where the Bearer fetches them.
|
|
109
|
+
*/
|
|
110
|
+
tree?: CustomerDeliverableTree | null;
|
|
111
|
+
client?: CustomerContentClientLike | null;
|
|
112
|
+
className?: string;
|
|
113
|
+
}
|
|
114
|
+
/** The player's labels: the same mapping hosted sites use */
|
|
115
|
+
declare function playerLabelsFrom(messages: VisitorMessages): DeliverablePlayerLabels;
|
|
116
|
+
declare function KanorioUnit({ deliverable, unit, onUnitChange, onProgress, renderUnauthenticated, tree: givenTree, client: givenClient, className, ...config }: KanorioUnitProps): react_jsx_runtime.JSX.Element;
|
|
117
|
+
|
|
118
|
+
export { KanorioUnit, type KanorioUnitProps, playerLabelsFrom };
|
package/dist/unit.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{KanorioUnit,playerLabelsFrom}from"./chunk-4KA3HSRQ.js";import"./chunk-MC63CLSM.js";import"./chunk-AF46NLXK.js";import"./chunk-4MOCTNN7.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import"./chunk-MIQK3T3Y.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{KanorioUnit,playerLabelsFrom};
|
|
2
|
+
//# sourceMappingURL=unit.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{EmbedProvider}from"./chunk-M5GS2ENM.js";import{
|
|
2
|
-
//# sourceMappingURL=vidstack-BmcqUMKx-
|
|
1
|
+
"use client";import{EmbedProvider}from"./chunk-M5GS2ENM.js";import{resolveYouTubeVideoId}from"./chunk-EY4JAVE3.js";import{TimeRange,preconnect}from"./chunk-ZDU7A7WZ.js";import{createScope,deferredPromise,effect,isBoolean,isNumber,isObject,isString,signal}from"./chunk-F5NEDREL.js";import"./chunk-3ZTUZPSD.js";var YouTubePlayerState={Unstarted:-1,Ended:0,Playing:1,Paused:2,Buffering:3,Cued:5};var YouTubeProvider=class extends EmbedProvider{$$PROVIDER_TYPE="YOUTUBE";scope=createScope();#ctx;#videoId=signal("");#state=-1;#currentSrc=null;#seekingTimer=-1;#invalidPlay=false;#promises=new Map;constructor(iframe,ctx){super(iframe);this.#ctx=ctx}language="en";color="red";cookies=false;get currentSrc(){return this.#currentSrc}get type(){return"youtube"}get videoId(){return this.#videoId()}preconnect(){preconnect(this.getOrigin())}setup(){super.setup();effect(this.#watchVideoId.bind(this));this.#ctx.notify("provider-setup",this)}destroy(){this.#reset();const message="provider destroyed";for(const promises of this.#promises.values())for(const{reject}of promises)reject(message);this.#promises.clear()}async play(){return this.#remote("playVideo")}#playFail(message){this.#getPromise("playVideo")?.reject(message)}async pause(){return this.#remote("pauseVideo")}#pauseFail(message){this.#getPromise("pauseVideo")?.reject(message)}setMuted(muted){if(muted)this.#remote("mute");else this.#remote("unMute")}setCurrentTime(time){this.#remote("seekTo",[time,true]);this.#ctx.notify("seeking",time)}setVolume(volume){this.#remote("setVolume",volume*100)}setPlaybackRate(rate){this.#remote("setPlaybackRate",rate)}async loadSource(src){if(!isString(src.src)){this.#currentSrc=null;this.#videoId.set("");return}const videoId=resolveYouTubeVideoId(src.src);this.#videoId.set(videoId??"");this.#currentSrc=src}getOrigin(){return!this.cookies?"https://www.youtube-nocookie.com":"https://www.youtube.com"}#watchVideoId(){this.#reset();const videoId=this.#videoId();if(!videoId){this.src.set("");return}this.src.set(`${this.getOrigin()}/embed/${videoId}`);this.#ctx.notify("load-start")}buildParams(){const{keyDisabled}=this.#ctx.$props,{muted,playsInline,nativeControls}=this.#ctx.$state,showControls=nativeControls();return{rel:0,autoplay:0,cc_lang_pref:this.language,cc_load_policy:showControls?1:void 0,color:this.color,controls:showControls?1:0,disablekb:!showControls||keyDisabled()?1:0,enablejsapi:1,fs:1,hl:this.language,iv_load_policy:showControls?1:3,mute:muted()?1:0,playsinline:playsInline()?1:0}}#remote(command,arg){let promise=deferredPromise(),promises=this.#promises.get(command);if(!promises)this.#promises.set(command,promises=[]);promises.push(promise);const args=Array.isArray(arg)?arg:arg?[arg]:void 0;this.postMessage({event:"command",func:command,args});return promise.promise}onLoad(){window.setTimeout(()=>this.postMessage({event:"listening"}),100)}#onReady(trigger){this.#ctx.notify("loaded-metadata");this.#ctx.notify("loaded-data");this.#ctx.delegate.ready(void 0,trigger)}#onPause(trigger){this.#getPromise("pauseVideo")?.resolve();this.#ctx.notify("pause",void 0,trigger)}#onTimeUpdate(time,trigger){const{duration,realCurrentTime}=this.#ctx.$state,hasEnded=this.#state===YouTubePlayerState.Ended,boundTime=hasEnded?duration():time;this.#ctx.notify("time-change",boundTime,trigger);if(!hasEnded&&Math.abs(boundTime-realCurrentTime())>1)this.#ctx.notify("seeking",boundTime,trigger)}#onProgress(buffered,seekable,trigger){const detail={buffered:new TimeRange(0,buffered),seekable};this.#ctx.notify("progress",detail,trigger);const{seeking,realCurrentTime}=this.#ctx.$state;if(seeking()&&buffered>realCurrentTime())this.#onSeeked(trigger)}#onSeeked(trigger){const{paused,realCurrentTime}=this.#ctx.$state;window.clearTimeout(this.#seekingTimer);this.#seekingTimer=window.setTimeout(()=>{this.#ctx.notify("seeked",realCurrentTime(),trigger);this.#seekingTimer=-1},paused()?100:0)}#onEnded(trigger){const{seeking}=this.#ctx.$state;if(seeking())this.#onSeeked(trigger);this.#ctx.notify("pause",void 0,trigger);this.#ctx.notify("end",void 0,trigger)}#onStateChange(state,trigger){const{paused,seeking}=this.#ctx.$state,isPlaying=state===YouTubePlayerState.Playing,isBuffering=state===YouTubePlayerState.Buffering,isPendingPlay=this.#isPending("playVideo"),isPlay=paused()&&(isBuffering||isPlaying);if(isBuffering)this.#ctx.notify("waiting",void 0,trigger);if(seeking()&&isPlaying)this.#onSeeked(trigger);if(this.#invalidPlay&&isPlaying){this.pause();this.#invalidPlay=false;this.setMuted(this.#ctx.$state.muted());return}if(!isPendingPlay&&isPlay){this.#invalidPlay=true;this.setMuted(true);return}if(isPlay){this.#getPromise("playVideo")?.resolve();this.#ctx.notify("play",void 0,trigger)}switch(state){case YouTubePlayerState.Cued:this.#onReady(trigger);break;case YouTubePlayerState.Playing:this.#ctx.notify("playing",void 0,trigger);break;case YouTubePlayerState.Paused:this.#onPause(trigger);break;case YouTubePlayerState.Ended:this.#onEnded(trigger);break}this.#state=state}onMessage({info},event){if(!info)return;const{title,intrinsicDuration,playbackRate}=this.#ctx.$state;if(isObject(info.videoData)&&info.videoData.title!==title())this.#ctx.notify("title-change",info.videoData.title,event);if(isNumber(info.duration)&&info.duration!==intrinsicDuration()){if(isNumber(info.videoLoadedFraction)){const buffered=info.progressState?.loaded??info.videoLoadedFraction*info.duration,seekable=new TimeRange(0,info.duration);this.#onProgress(buffered,seekable,event)}this.#ctx.notify("duration-change",info.duration,event)}if(isNumber(info.playbackRate)&&info.playbackRate!==playbackRate())this.#ctx.notify("rate-change",info.playbackRate,event);if(info.progressState){const{current,seekableStart,seekableEnd,loaded,duration}=info.progressState;this.#onTimeUpdate(current,event);this.#onProgress(loaded,new TimeRange(seekableStart,seekableEnd),event);if(duration!==intrinsicDuration())this.#ctx.notify("duration-change",duration,event)}if(isNumber(info.volume)&&isBoolean(info.muted)&&!this.#invalidPlay){const detail={muted:info.muted,volume:info.volume/100};this.#ctx.notify("volume-change",detail,event)}if(isNumber(info.playerState)&&info.playerState!==this.#state)this.#onStateChange(info.playerState,event)}#reset(){this.#state=-1;this.#seekingTimer=-1;this.#invalidPlay=false}#getPromise(command){return this.#promises.get(command)?.shift()}#isPending(command){return Boolean(this.#promises.get(command)?.length)}};export{YouTubeProvider};
|
|
2
|
+
//# sourceMappingURL=vidstack-BmcqUMKx-FXVV4FRB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{getVimeoVideoInfo,resolveVimeoVideoId}from"./chunk-HBNSRIEP.js";import{EmbedProvider}from"./chunk-M5GS2ENM.js";import{ListSymbol,QualitySymbol,RAFLoop,TextTrack,TimeRange,preconnect}from"./chunk-ZDU7A7WZ.js";import{createScope,deferredPromise,effect,isArray,isString,listenEvent,peek,signal}from"./chunk-F5NEDREL.js";import"./chunk-3ZTUZPSD.js";var trackedVimeoEvents=["bufferend","bufferstart","durationchange","ended","enterpictureinpicture","error","fullscreenchange","leavepictureinpicture","loaded","playProgress","loadProgress","pause","play","playbackratechange","qualitychange","seeked","seeking","timeupdate","volumechange","waiting"];var VimeoProvider=class extends EmbedProvider{$$PROVIDER_TYPE="VIMEO";scope=createScope();fullscreen;#ctx;#videoId=signal("");#pro=signal(false);#hash=null;#currentSrc=null;#fullscreenActive=false;#seekableRange=new TimeRange(0,0);#timeRAF=new RAFLoop(this.#onAnimationFrame.bind(this));#currentCue=null;#chaptersTrack=null;#promises=new Map;#videoInfoPromise=null;constructor(iframe,ctx){super(iframe);this.#ctx=ctx;const self=this;this.fullscreen={get active(){return self.#fullscreenActive},supported:true,enter:()=>this.#remote("requestFullscreen"),exit:()=>this.#remote("exitFullscreen")}}cookies=false;title=true;byline=true;portrait=true;color="00ADEF";get type(){return"vimeo"}get currentSrc(){return this.#currentSrc}get videoId(){return this.#videoId()}get hash(){return this.#hash}get isPro(){return this.#pro()}preconnect(){preconnect(this.getOrigin())}setup(){super.setup();effect(this.#watchVideoId.bind(this));effect(this.#watchVideoInfo.bind(this));effect(this.#watchPro.bind(this));this.#ctx.notify("provider-setup",this)}destroy(){this.#reset();this.fullscreen=void 0;const message="provider destroyed";for(const promises of this.#promises.values())for(const{reject}of promises)reject(message);this.#promises.clear();this.#remote("destroy")}async play(){return this.#remote("play")}async pause(){return this.#remote("pause")}setMuted(muted){this.#remote("setMuted",muted)}setCurrentTime(time){this.#remote("seekTo",time);this.#ctx.notify("seeking",time)}setVolume(volume){this.#remote("setVolume",volume);this.#remote("setMuted",peek(this.#ctx.$state.muted))}setPlaybackRate(rate){this.#remote("setPlaybackRate",rate)}async loadSource(src){if(!isString(src.src)){this.#currentSrc=null;this.#hash=null;this.#videoId.set("");return}const{videoId,hash}=resolveVimeoVideoId(src.src);this.#videoId.set(videoId??"");this.#hash=hash??null;this.#currentSrc=src}#watchVideoId(){this.#reset();const videoId=this.#videoId();if(!videoId){this.src.set("");return}this.src.set(`${this.getOrigin()}/video/${videoId}`);this.#ctx.notify("load-start")}#watchVideoInfo(){const videoId=this.#videoId();if(!videoId)return;const promise=deferredPromise(),abort=new AbortController;this.#videoInfoPromise=promise;getVimeoVideoInfo(videoId,abort,this.#hash).then(info=>{promise.resolve(info)}).catch(e=>{promise.reject()});return()=>{promise.reject();abort.abort()}}#watchPro(){const isPro=this.#pro(),{$state,qualities}=this.#ctx;$state.canSetPlaybackRate.set(isPro);qualities[ListSymbol.setReadonly](!isPro);if(isPro)return listenEvent(qualities,"change",()=>{if(qualities.auto)return;const id=qualities.selected?.id;if(id)this.#remote("setQuality",id)})}getOrigin(){return"https://player.vimeo.com"}buildParams(){const{keyDisabled}=this.#ctx.$props,{playsInline,nativeControls}=this.#ctx.$state,showControls=nativeControls();return{title:this.title,byline:this.byline,color:this.color,portrait:this.portrait,controls:showControls,h:this.hash,keyboard:showControls&&!keyDisabled(),transparent:true,playsinline:playsInline(),dnt:!this.cookies}}#onAnimationFrame(){this.#remote("getCurrentTime")}#preventTimeUpdates=false;#onTimeUpdate(time,trigger){if(this.#preventTimeUpdates&&time===0)return;const{realCurrentTime,paused,bufferedEnd,seekableEnd,live}=this.#ctx.$state;if(realCurrentTime()===time)return;const prevTime=realCurrentTime();this.#ctx.notify("time-change",time,trigger);if(Math.abs(prevTime-time)>1.5){this.#ctx.notify("seeking",time,trigger);if(!paused()&&bufferedEnd()<time)this.#ctx.notify("waiting",void 0,trigger)}if(!live()&&seekableEnd()-time<.01){this.#ctx.notify("end",void 0,trigger);this.#preventTimeUpdates=true;setTimeout(()=>{this.#preventTimeUpdates=false},500)}}#onSeeked(time,trigger){this.#ctx.notify("seeked",time,trigger)}#onLoaded(trigger){const videoId=this.#videoId();this.#videoInfoPromise?.promise.then(info=>{if(!info)return;const{title,poster,duration,pro}=info;this.#pro.set(pro);this.#ctx.notify("title-change",title,trigger);this.#ctx.notify("poster-change",poster,trigger);this.#ctx.notify("duration-change",duration,trigger);this.#onReady(duration,trigger)}).catch(()=>{if(videoId!==this.#videoId())return;this.#remote("getVideoTitle");this.#remote("getDuration")})}#onReady(duration,trigger){const{nativeControls}=this.#ctx.$state,showEmbedControls=nativeControls();this.#seekableRange=new TimeRange(0,duration);const detail={buffered:new TimeRange(0,0),seekable:this.#seekableRange,duration};this.#ctx.delegate.ready(detail,trigger);if(!showEmbedControls)this.#remote("_hideOverlay");this.#remote("getQualities");this.#remote("getChapters")}#onMethod(method,data,trigger){switch(method){case"getVideoTitle":const videoTitle=data;this.#ctx.notify("title-change",videoTitle,trigger);break;case"getDuration":const duration=data;if(!this.#ctx.$state.canPlay())this.#onReady(duration,trigger);else this.#ctx.notify("duration-change",duration,trigger);break;case"getCurrentTime":this.#onTimeUpdate(data,trigger);break;case"getBuffered":if(isArray(data)&&data.length)this.#onLoadProgress(data[data.length-1][1],trigger);break;case"setMuted":case"getMuted":this.#onVolumeChange(peek(this.#ctx.$state.volume),data,trigger);break;case"getChapters":this.#onChaptersChange(data);break;case"getQualities":this.#onQualitiesChange(data,trigger);break}this.#getPromise(method)?.resolve()}#attachListeners(){for(const type of trackedVimeoEvents)this.#remote("addEventListener",type)}#onPause(trigger){this.#timeRAF.stop();this.#ctx.notify("pause",void 0,trigger)}async#onPlay(trigger){this.#timeRAF.start();await this.#remote("getMuted");this.#ctx.notify("play",void 0,trigger)}#onPlayProgress(trigger){const{paused}=this.#ctx.$state;if(!paused()&&!this.#preventTimeUpdates)this.#ctx.notify("playing",void 0,trigger)}#onLoadProgress(buffered,trigger){const detail={buffered:new TimeRange(0,buffered),seekable:this.#seekableRange};this.#ctx.notify("progress",detail,trigger)}#onBufferStart(trigger){this.#ctx.notify("waiting",void 0,trigger)}#onBufferEnd(trigger){const{paused}=this.#ctx.$state;if(!paused())this.#ctx.notify("playing",void 0,trigger)}async#onWaiting(trigger){const{paused}=this.#ctx.$state;if(paused()){await this.#remote("getMuted");this.#ctx.notify("play",void 0,trigger)}this.#ctx.notify("waiting",void 0,trigger)}#onVolumeChange(volume,muted,trigger){const detail={volume,muted};this.#ctx.notify("volume-change",detail,trigger)}#onChaptersChange(chapters){this.#removeChapters();if(!chapters.length)return;const track=new TextTrack({kind:"chapters",default:true}),{seekableEnd}=this.#ctx.$state;for(let i=0;i<chapters.length;i++){const chapter=chapters[i],nextChapter=chapters[i+1];track.addCue(new window.VTTCue(chapter.startTime,nextChapter?.startTime??seekableEnd(),chapter.title))}this.#chaptersTrack=track;this.#ctx.textTracks.add(track)}#removeChapters(){if(!this.#chaptersTrack)return;this.#ctx.textTracks.remove(this.#chaptersTrack);this.#chaptersTrack=null}#onQualitiesChange(qualities,trigger){this.#ctx.qualities[QualitySymbol.enableAuto]=qualities.some(q=>q.id==="auto")?()=>this.#remote("setQuality","auto"):void 0;for(const quality of qualities){if(quality.id==="auto")continue;const height=+quality.id.slice(0,-1);if(isNaN(height))continue;this.#ctx.qualities[ListSymbol.add]({id:quality.id,width:height*(16/9),height,codec:"avc1,h.264",bitrate:-1},trigger)}this.#onQualityChange(qualities.find(q=>q.active),trigger)}#onQualityChange({id}={},trigger){if(!id)return;const isAuto=id==="auto",newQuality=this.#ctx.qualities.getById(id);if(isAuto){this.#ctx.qualities[QualitySymbol.setAuto](isAuto,trigger);this.#ctx.qualities[ListSymbol.select](void 0,true,trigger)}else this.#ctx.qualities[ListSymbol.select](newQuality??void 0,true,trigger)}#onEvent(event,payload,trigger){switch(event){case"ready":this.#attachListeners();break;case"loaded":this.#onLoaded(trigger);break;case"play":this.#onPlay(trigger);break;case"playProgress":this.#onPlayProgress(trigger);break;case"pause":this.#onPause(trigger);break;case"loadProgress":this.#onLoadProgress(payload.seconds,trigger);break;case"waiting":this.#onWaiting(trigger);break;case"bufferstart":this.#onBufferStart(trigger);break;case"bufferend":this.#onBufferEnd(trigger);break;case"volumechange":this.#onVolumeChange(payload.volume,peek(this.#ctx.$state.muted),trigger);break;case"durationchange":this.#seekableRange=new TimeRange(0,payload.duration);this.#ctx.notify("duration-change",payload.duration,trigger);break;case"playbackratechange":this.#ctx.notify("rate-change",payload.playbackRate,trigger);break;case"qualitychange":this.#onQualityChange(payload,trigger);break;case"fullscreenchange":this.#fullscreenActive=payload.fullscreen;this.#ctx.notify("fullscreen-change",payload.fullscreen,trigger);break;case"enterpictureinpicture":this.#ctx.notify("picture-in-picture-change",true,trigger);break;case"leavepictureinpicture":this.#ctx.notify("picture-in-picture-change",false,trigger);break;case"ended":this.#ctx.notify("end",void 0,trigger);break;case"error":this.#onError(payload,trigger);break;case"seek":case"seeked":this.#onSeeked(payload.seconds,trigger);break}}#onError(error,trigger){const{message,method}=error;if(method==="setPlaybackRate")this.#pro.set(false);if(method)this.#getPromise(method)?.reject(message)}onMessage(message,event){if(message.event)this.#onEvent(message.event,message.data,event);else if(message.method)this.#onMethod(message.method,message.value,event)}onLoad(){}async#remote(command,arg){let promise=deferredPromise(),promises=this.#promises.get(command);if(!promises)this.#promises.set(command,promises=[]);promises.push(promise);this.postMessage({method:command,value:arg});return promise.promise}#reset(){this.#timeRAF.stop();this.#seekableRange=new TimeRange(0,0);this.#videoInfoPromise=null;this.#currentCue=null;this.#pro.set(false);this.#removeChapters()}#getPromise(command){return this.#promises.get(command)?.shift()}};export{VimeoProvider};
|
|
2
|
-
//# sourceMappingURL=vidstack-GkTzay8D-
|
|
1
|
+
"use client";import{EmbedProvider}from"./chunk-M5GS2ENM.js";import{ListSymbol,QualitySymbol,RAFLoop,TextTrack,TimeRange,preconnect}from"./chunk-ZDU7A7WZ.js";import{getVimeoVideoInfo,resolveVimeoVideoId}from"./chunk-HBNSRIEP.js";import{createScope,deferredPromise,effect,isArray,isString,listenEvent,peek,signal}from"./chunk-F5NEDREL.js";import"./chunk-3ZTUZPSD.js";var trackedVimeoEvents=["bufferend","bufferstart","durationchange","ended","enterpictureinpicture","error","fullscreenchange","leavepictureinpicture","loaded","playProgress","loadProgress","pause","play","playbackratechange","qualitychange","seeked","seeking","timeupdate","volumechange","waiting"];var VimeoProvider=class extends EmbedProvider{$$PROVIDER_TYPE="VIMEO";scope=createScope();fullscreen;#ctx;#videoId=signal("");#pro=signal(false);#hash=null;#currentSrc=null;#fullscreenActive=false;#seekableRange=new TimeRange(0,0);#timeRAF=new RAFLoop(this.#onAnimationFrame.bind(this));#currentCue=null;#chaptersTrack=null;#promises=new Map;#videoInfoPromise=null;constructor(iframe,ctx){super(iframe);this.#ctx=ctx;const self=this;this.fullscreen={get active(){return self.#fullscreenActive},supported:true,enter:()=>this.#remote("requestFullscreen"),exit:()=>this.#remote("exitFullscreen")}}cookies=false;title=true;byline=true;portrait=true;color="00ADEF";get type(){return"vimeo"}get currentSrc(){return this.#currentSrc}get videoId(){return this.#videoId()}get hash(){return this.#hash}get isPro(){return this.#pro()}preconnect(){preconnect(this.getOrigin())}setup(){super.setup();effect(this.#watchVideoId.bind(this));effect(this.#watchVideoInfo.bind(this));effect(this.#watchPro.bind(this));this.#ctx.notify("provider-setup",this)}destroy(){this.#reset();this.fullscreen=void 0;const message="provider destroyed";for(const promises of this.#promises.values())for(const{reject}of promises)reject(message);this.#promises.clear();this.#remote("destroy")}async play(){return this.#remote("play")}async pause(){return this.#remote("pause")}setMuted(muted){this.#remote("setMuted",muted)}setCurrentTime(time){this.#remote("seekTo",time);this.#ctx.notify("seeking",time)}setVolume(volume){this.#remote("setVolume",volume);this.#remote("setMuted",peek(this.#ctx.$state.muted))}setPlaybackRate(rate){this.#remote("setPlaybackRate",rate)}async loadSource(src){if(!isString(src.src)){this.#currentSrc=null;this.#hash=null;this.#videoId.set("");return}const{videoId,hash}=resolveVimeoVideoId(src.src);this.#videoId.set(videoId??"");this.#hash=hash??null;this.#currentSrc=src}#watchVideoId(){this.#reset();const videoId=this.#videoId();if(!videoId){this.src.set("");return}this.src.set(`${this.getOrigin()}/video/${videoId}`);this.#ctx.notify("load-start")}#watchVideoInfo(){const videoId=this.#videoId();if(!videoId)return;const promise=deferredPromise(),abort=new AbortController;this.#videoInfoPromise=promise;getVimeoVideoInfo(videoId,abort,this.#hash).then(info=>{promise.resolve(info)}).catch(e=>{promise.reject()});return()=>{promise.reject();abort.abort()}}#watchPro(){const isPro=this.#pro(),{$state,qualities}=this.#ctx;$state.canSetPlaybackRate.set(isPro);qualities[ListSymbol.setReadonly](!isPro);if(isPro)return listenEvent(qualities,"change",()=>{if(qualities.auto)return;const id=qualities.selected?.id;if(id)this.#remote("setQuality",id)})}getOrigin(){return"https://player.vimeo.com"}buildParams(){const{keyDisabled}=this.#ctx.$props,{playsInline,nativeControls}=this.#ctx.$state,showControls=nativeControls();return{title:this.title,byline:this.byline,color:this.color,portrait:this.portrait,controls:showControls,h:this.hash,keyboard:showControls&&!keyDisabled(),transparent:true,playsinline:playsInline(),dnt:!this.cookies}}#onAnimationFrame(){this.#remote("getCurrentTime")}#preventTimeUpdates=false;#onTimeUpdate(time,trigger){if(this.#preventTimeUpdates&&time===0)return;const{realCurrentTime,paused,bufferedEnd,seekableEnd,live}=this.#ctx.$state;if(realCurrentTime()===time)return;const prevTime=realCurrentTime();this.#ctx.notify("time-change",time,trigger);if(Math.abs(prevTime-time)>1.5){this.#ctx.notify("seeking",time,trigger);if(!paused()&&bufferedEnd()<time)this.#ctx.notify("waiting",void 0,trigger)}if(!live()&&seekableEnd()-time<.01){this.#ctx.notify("end",void 0,trigger);this.#preventTimeUpdates=true;setTimeout(()=>{this.#preventTimeUpdates=false},500)}}#onSeeked(time,trigger){this.#ctx.notify("seeked",time,trigger)}#onLoaded(trigger){const videoId=this.#videoId();this.#videoInfoPromise?.promise.then(info=>{if(!info)return;const{title,poster,duration,pro}=info;this.#pro.set(pro);this.#ctx.notify("title-change",title,trigger);this.#ctx.notify("poster-change",poster,trigger);this.#ctx.notify("duration-change",duration,trigger);this.#onReady(duration,trigger)}).catch(()=>{if(videoId!==this.#videoId())return;this.#remote("getVideoTitle");this.#remote("getDuration")})}#onReady(duration,trigger){const{nativeControls}=this.#ctx.$state,showEmbedControls=nativeControls();this.#seekableRange=new TimeRange(0,duration);const detail={buffered:new TimeRange(0,0),seekable:this.#seekableRange,duration};this.#ctx.delegate.ready(detail,trigger);if(!showEmbedControls)this.#remote("_hideOverlay");this.#remote("getQualities");this.#remote("getChapters")}#onMethod(method,data,trigger){switch(method){case"getVideoTitle":const videoTitle=data;this.#ctx.notify("title-change",videoTitle,trigger);break;case"getDuration":const duration=data;if(!this.#ctx.$state.canPlay())this.#onReady(duration,trigger);else this.#ctx.notify("duration-change",duration,trigger);break;case"getCurrentTime":this.#onTimeUpdate(data,trigger);break;case"getBuffered":if(isArray(data)&&data.length)this.#onLoadProgress(data[data.length-1][1],trigger);break;case"setMuted":case"getMuted":this.#onVolumeChange(peek(this.#ctx.$state.volume),data,trigger);break;case"getChapters":this.#onChaptersChange(data);break;case"getQualities":this.#onQualitiesChange(data,trigger);break}this.#getPromise(method)?.resolve()}#attachListeners(){for(const type of trackedVimeoEvents)this.#remote("addEventListener",type)}#onPause(trigger){this.#timeRAF.stop();this.#ctx.notify("pause",void 0,trigger)}async#onPlay(trigger){this.#timeRAF.start();await this.#remote("getMuted");this.#ctx.notify("play",void 0,trigger)}#onPlayProgress(trigger){const{paused}=this.#ctx.$state;if(!paused()&&!this.#preventTimeUpdates)this.#ctx.notify("playing",void 0,trigger)}#onLoadProgress(buffered,trigger){const detail={buffered:new TimeRange(0,buffered),seekable:this.#seekableRange};this.#ctx.notify("progress",detail,trigger)}#onBufferStart(trigger){this.#ctx.notify("waiting",void 0,trigger)}#onBufferEnd(trigger){const{paused}=this.#ctx.$state;if(!paused())this.#ctx.notify("playing",void 0,trigger)}async#onWaiting(trigger){const{paused}=this.#ctx.$state;if(paused()){await this.#remote("getMuted");this.#ctx.notify("play",void 0,trigger)}this.#ctx.notify("waiting",void 0,trigger)}#onVolumeChange(volume,muted,trigger){const detail={volume,muted};this.#ctx.notify("volume-change",detail,trigger)}#onChaptersChange(chapters){this.#removeChapters();if(!chapters.length)return;const track=new TextTrack({kind:"chapters",default:true}),{seekableEnd}=this.#ctx.$state;for(let i=0;i<chapters.length;i++){const chapter=chapters[i],nextChapter=chapters[i+1];track.addCue(new window.VTTCue(chapter.startTime,nextChapter?.startTime??seekableEnd(),chapter.title))}this.#chaptersTrack=track;this.#ctx.textTracks.add(track)}#removeChapters(){if(!this.#chaptersTrack)return;this.#ctx.textTracks.remove(this.#chaptersTrack);this.#chaptersTrack=null}#onQualitiesChange(qualities,trigger){this.#ctx.qualities[QualitySymbol.enableAuto]=qualities.some(q=>q.id==="auto")?()=>this.#remote("setQuality","auto"):void 0;for(const quality of qualities){if(quality.id==="auto")continue;const height=+quality.id.slice(0,-1);if(isNaN(height))continue;this.#ctx.qualities[ListSymbol.add]({id:quality.id,width:height*(16/9),height,codec:"avc1,h.264",bitrate:-1},trigger)}this.#onQualityChange(qualities.find(q=>q.active),trigger)}#onQualityChange({id}={},trigger){if(!id)return;const isAuto=id==="auto",newQuality=this.#ctx.qualities.getById(id);if(isAuto){this.#ctx.qualities[QualitySymbol.setAuto](isAuto,trigger);this.#ctx.qualities[ListSymbol.select](void 0,true,trigger)}else this.#ctx.qualities[ListSymbol.select](newQuality??void 0,true,trigger)}#onEvent(event,payload,trigger){switch(event){case"ready":this.#attachListeners();break;case"loaded":this.#onLoaded(trigger);break;case"play":this.#onPlay(trigger);break;case"playProgress":this.#onPlayProgress(trigger);break;case"pause":this.#onPause(trigger);break;case"loadProgress":this.#onLoadProgress(payload.seconds,trigger);break;case"waiting":this.#onWaiting(trigger);break;case"bufferstart":this.#onBufferStart(trigger);break;case"bufferend":this.#onBufferEnd(trigger);break;case"volumechange":this.#onVolumeChange(payload.volume,peek(this.#ctx.$state.muted),trigger);break;case"durationchange":this.#seekableRange=new TimeRange(0,payload.duration);this.#ctx.notify("duration-change",payload.duration,trigger);break;case"playbackratechange":this.#ctx.notify("rate-change",payload.playbackRate,trigger);break;case"qualitychange":this.#onQualityChange(payload,trigger);break;case"fullscreenchange":this.#fullscreenActive=payload.fullscreen;this.#ctx.notify("fullscreen-change",payload.fullscreen,trigger);break;case"enterpictureinpicture":this.#ctx.notify("picture-in-picture-change",true,trigger);break;case"leavepictureinpicture":this.#ctx.notify("picture-in-picture-change",false,trigger);break;case"ended":this.#ctx.notify("end",void 0,trigger);break;case"error":this.#onError(payload,trigger);break;case"seek":case"seeked":this.#onSeeked(payload.seconds,trigger);break}}#onError(error,trigger){const{message,method}=error;if(method==="setPlaybackRate")this.#pro.set(false);if(method)this.#getPromise(method)?.reject(message)}onMessage(message,event){if(message.event)this.#onEvent(message.event,message.data,event);else if(message.method)this.#onMethod(message.method,message.value,event)}onLoad(){}async#remote(command,arg){let promise=deferredPromise(),promises=this.#promises.get(command);if(!promises)this.#promises.set(command,promises=[]);promises.push(promise);this.postMessage({method:command,value:arg});return promise.promise}#reset(){this.#timeRAF.stop();this.#seekableRange=new TimeRange(0,0);this.#videoInfoPromise=null;this.#currentCue=null;this.#pro.set(false);this.#removeChapters()}#getPromise(command){return this.#promises.get(command)?.shift()}};export{VimeoProvider};
|
|
2
|
+
//# sourceMappingURL=vidstack-GkTzay8D-53C3FRCO.js.map
|
package/dist/web-components.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Web Component shell: each custom element mounts one React root and maps attributes to props (kebab to camel case, JSON attributes parsed automatically).
|
|
3
5
|
* `defineKanorioElements()` is idempotent; the CDN build calls it on load.
|
|
@@ -6,7 +8,17 @@
|
|
|
6
8
|
* <kanorio-account site-url="https://demo.kanorio.com"></kanorio-account>
|
|
7
9
|
* <kanorio-unit site-url="https://demo.kanorio.com" deliverable="cmw0abc123"></kanorio-unit>
|
|
8
10
|
*/
|
|
11
|
+
|
|
9
12
|
declare function attributesToProps(el: Element): Record<string, unknown>;
|
|
13
|
+
type AnyComponent = ComponentType<Record<string, unknown>>;
|
|
14
|
+
/** The tags `defineKanorioElements()` registers */
|
|
15
|
+
declare const KANORIO_ELEMENT_TAGS: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* Downloads one element's implementation and resolves to its React component. The custom element does this by itself when it is
|
|
18
|
+
* connected; call it earlier to warm the cache (for example on hover, before a dialog that contains the element opens).
|
|
19
|
+
*/
|
|
20
|
+
declare function loadKanorioElement(tag: string): Promise<AnyComponent>;
|
|
21
|
+
/** Registers the custom elements. Idempotent. No element's implementation is downloaded until its tag is on the page. */
|
|
10
22
|
declare function defineKanorioElements(): void;
|
|
11
23
|
|
|
12
|
-
export { attributesToProps, defineKanorioElements };
|
|
24
|
+
export { KANORIO_ELEMENT_TAGS, attributesToProps, defineKanorioElements, loadKanorioElement };
|
package/dist/web-components.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{FORM_SUBMIT_EVENT,
|
|
1
|
+
import{FORM_SUBMIT_EVENT,LOGIN_EVENT,LOGOUT_EVENT,PROGRESS_EVENT,UNIT_CHANGE_EVENT}from"./chunk-LWKCGUHS.js";import{createLoadRetry}from"./chunk-TEUQV3AT.js";import{setAltchaLoadedHook}from"./chunk-JH5D6YJX.js";import"./chunk-3ZTUZPSD.js";import{createElement,Suspense}from"react";import{createRoot}from"react-dom/client";var blobUrls=new Map;function workerScriptUrl(workerUrl){return String(new URL(workerUrl||"./worker.js",import.meta.url))}function isCrossOriginBundle(){if(typeof window==="undefined"||typeof window.location==="undefined")return false;try{return new URL(import.meta.url).origin!==window.location.origin}catch{return false}}function createSameOriginWorker(scriptUrl){let blobUrl=blobUrls.get(scriptUrl);if(!blobUrl){blobUrl=URL.createObjectURL(new Blob([`importScripts(${JSON.stringify(scriptUrl)});`],{type:"text/javascript"}));blobUrls.set(scriptUrl,blobUrl)}return new Worker(blobUrl)}function installAltchaWorkerFix(){if(!isCrossOriginBundle())return;setAltchaLoadedHook(()=>{globalThis.altchaCreateWorker=workerUrl=>createSameOriginWorker(workerScriptUrl(workerUrl))})}var JSON_ATTRS=new Set(["images","alts","filenames","protection","outline","expand-all","allow-download","auto-play","loop","muted","columns","page-count","file-size","brand","follow-redirect","hidden-values","captions"]);function parseAttr(name,value){if(!JSON_ATTRS.has(name))return value;if(value==="")return true;try{return JSON.parse(value)}catch{return value}}function camel(name){return name.replace(/-([a-z])/g,(_,c)=>c.toUpperCase())}function attributesToProps(el){const props={};for(const attr of Array.from(el.attributes)){if(attr.name==="class"||attr.name==="style"||attr.name==="id"||attr.name===LOAD_ERROR_ATTRIBUTE)continue;props[camel(attr.name)]=parseAttr(attr.name,attr.value)}return props}var LOAD_ERROR_ATTRIBUTE="data-kanorio-load-error";var as=component=>component;var ELEMENTS={"kanorio-media":{load:()=>import("./KanorioMedia-DLBSXCKA.js").then(m=>as(m.KanorioMedia))},"kanorio-lightbox":{load:()=>import("./KanorioLightbox-M72HNQQX.js").then(m=>as(m.KanorioLightbox))},"kanorio-unit":{load:()=>import("./KanorioUnit-SIM3344J.js").then(m=>as(m.KanorioUnit)),events:{onUnitChange:UNIT_CHANGE_EVENT,onProgress:PROGRESS_EVENT}},"kanorio-curriculum":{load:()=>import("./KanorioCurriculum-3QSCOHK7.js").then(m=>as(m.KanorioCurriculum))},"kanorio-reviews":{load:()=>import("./KanorioReviews-7LD5WKFG.js").then(m=>as(m.KanorioReviews))},"kanorio-rating":{load:()=>import("./KanorioReviews-7LD5WKFG.js").then(m=>as(m.KanorioRating))},"kanorio-account":{load:()=>import("./KanorioAccount-XGVSGVYN.js").then(m=>as(m.KanorioAccount)),events:{onLogin:LOGIN_EVENT,onLogout:LOGOUT_EVENT}},"kanorio-login":{load:()=>import("./KanorioLogin-AJHHVQGV.js").then(m=>as(m.KanorioLogin)),events:{onLogin:LOGIN_EVENT,onLogout:LOGOUT_EVENT}},"kanorio-form":{load:()=>import("./KanorioForm-GUA5GEJY.js").then(m=>as(m.KanorioForm)),events:{onSuccess:FORM_SUBMIT_EVENT}},"kanorio-analytics":{load:()=>import("./KanorioAnalytics-NEKTFQEE.js").then(m=>as(m.KanorioAnalytics))}};var KANORIO_ELEMENT_TAGS=Object.keys(ELEMENTS);var loading=new Map;function loadKanorioElement(tag){const spec=ELEMENTS[tag];if(!spec)return Promise.reject(new Error(`@kanorio/elements: unknown element <${tag}>`));let pending=loading.get(tag);if(!pending){pending=spec.load();pending.catch(()=>loading.delete(tag));loading.set(tag,pending)}return pending}function define(tag,spec){if(typeof customElements==="undefined"||customElements.get(tag))return;const events=spec.events??{};class KanorioElement extends HTMLElement{root=null;observer=null;component=null;retry=createLoadRetry({retry:()=>this.load(),onExhausted:()=>this.setAttribute(LOAD_ERROR_ATTRIBUTE,"")});connectedCallback(){this.root=createRoot(this);this.observer=new MutationObserver(()=>this.render());this.observer.observe(this,{attributes:true});this.load()}disconnectedCallback(){this.retry.dispose();this.observer?.disconnect();this.root?.unmount();this.root=null}load(){if(!this.root)return;this.removeAttribute(LOAD_ERROR_ATTRIBUTE);loadKanorioElement(tag).then(component=>{this.retry.succeeded();this.component=component;this.render()},()=>{if(this.root)this.retry.failed()})}render(){if(!this.root||!this.component)return;const props=attributesToProps(this);for(const[prop,eventName]of Object.entries(events)){props[prop]=detail=>this.dispatchEvent(new CustomEvent(eventName,{detail,bubbles:true}))}this.root.render(createElement(Suspense,{fallback:null},createElement(this.component,props)))}}customElements.define(tag,KanorioElement)}function defineKanorioElements(){installAltchaWorkerFix();for(const[tag,spec]of Object.entries(ELEMENTS))define(tag,spec)}export{KANORIO_ELEMENT_TAGS,attributesToProps,defineKanorioElements,loadKanorioElement};
|
|
2
2
|
//# sourceMappingURL=web-components.js.map
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response shapes of the Customer API (`{site}/api/v1/customer/*`; a public contract).
|
|
3
|
+
* Kanorio's server produces these objects; Elements, the hosted customer account and the SDK share the types. Fields are only added and meanings never change.
|
|
4
|
+
*/
|
|
5
|
+
/** `prerequisite`: blocked by sequential completion or by a gate unit; `access.lockedByUnitId` is the unit blocking it */
|
|
6
|
+
type UnitAccessReason = "entitlement" | "preview" | "none" | "not_released" | "expired" | "hidden" | "prerequisite";
|
|
7
|
+
type UnitProgressStatus = "not_started" | "in-progress" | "completed";
|
|
8
|
+
/** A quiz unit's summary for the learner (the questions are in `body`, a `PublicQuizBody`, which never contains correct answers) */
|
|
9
|
+
interface CustomerQuizSummary {
|
|
10
|
+
/** `graded`: passing completes the unit; `practice`: submitting completes it, with no pass mark and unlimited attempts. Absent on older servers (treated as graded) */
|
|
11
|
+
mode?: "graded" | "practice";
|
|
12
|
+
passingPercent: number;
|
|
13
|
+
/** Attempts allowed (including extra ones granted by the owner); null means unlimited */
|
|
14
|
+
maxAttempts: number | null;
|
|
15
|
+
attemptsUsed: number;
|
|
16
|
+
bestScore: number | null;
|
|
17
|
+
/** Graded: has passed at least once; practice: has submitted at least once */
|
|
18
|
+
passed: boolean;
|
|
19
|
+
canRetry: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** A deliverable's cover image (an image on this site; null when there is none or it was moved to the trash) */
|
|
22
|
+
interface DeliverableCover {
|
|
23
|
+
url: string;
|
|
24
|
+
width: number | null;
|
|
25
|
+
height: number | null;
|
|
26
|
+
/** The image's default alt text */
|
|
27
|
+
alt: string | null;
|
|
28
|
+
/** Low-quality placeholder data URL (16px WebP) */
|
|
29
|
+
placeholder: string | null;
|
|
30
|
+
}
|
|
31
|
+
/** A unit's attachment (handout, template, exercise file): file name and size only; get the download URL with `openUnit(unitId, "download", { attachmentId })` */
|
|
32
|
+
interface UnitAttachmentView {
|
|
33
|
+
/** The attachment's file id, passed as `attachmentId` to `openUnit` */
|
|
34
|
+
id: string;
|
|
35
|
+
fileName: string;
|
|
36
|
+
mimeType: string | null;
|
|
37
|
+
/** Bytes; null when unknown */
|
|
38
|
+
bytes: number | null;
|
|
39
|
+
}
|
|
40
|
+
interface CustomerUnitView {
|
|
41
|
+
id: string;
|
|
42
|
+
parentId: string | null;
|
|
43
|
+
order: number;
|
|
44
|
+
kind: string;
|
|
45
|
+
title: string | null;
|
|
46
|
+
description: string | null;
|
|
47
|
+
isPreview: boolean;
|
|
48
|
+
allowDownload: boolean;
|
|
49
|
+
/** Counts toward completion (false means optional: not part of the completion ratio, not blocked by sequence and does not block others); absent on older servers */
|
|
50
|
+
countsTowardCompletion?: boolean;
|
|
51
|
+
/** Gate: what follows cannot be viewed until this is completed; absent on older servers */
|
|
52
|
+
isPrerequisite?: boolean;
|
|
53
|
+
hasFile: boolean;
|
|
54
|
+
/** Attachments (in the owner's order); an empty array without access. Absent on older servers */
|
|
55
|
+
attachments?: UnitAttachmentView[];
|
|
56
|
+
embed: {
|
|
57
|
+
provider: string;
|
|
58
|
+
id: string;
|
|
59
|
+
} | null;
|
|
60
|
+
/** `{ markdown }` for a text unit; `PublicQuizBody` (without correct answers) for a quiz unit; null when locked */
|
|
61
|
+
body: unknown;
|
|
62
|
+
/** Quiz units only; null while the questions are not ready. Absent on older servers */
|
|
63
|
+
quiz?: CustomerQuizSummary | null;
|
|
64
|
+
duration: number | null;
|
|
65
|
+
pageCount: number | null;
|
|
66
|
+
mimeType: string | null;
|
|
67
|
+
/** `lockedByUnitId`: the unit blocking it when reason is `prerequisite`; absent on older servers */
|
|
68
|
+
access: {
|
|
69
|
+
granted: boolean;
|
|
70
|
+
reason: UnitAccessReason;
|
|
71
|
+
availableAt: string | null;
|
|
72
|
+
lockedByUnitId?: string | null;
|
|
73
|
+
};
|
|
74
|
+
progress: UnitProgressStatus;
|
|
75
|
+
/** The furthest second watched (only moves forward; used for progress) */
|
|
76
|
+
positionSeconds: number;
|
|
77
|
+
/** Where playback last stopped (seconds; resume from here); absent on older servers */
|
|
78
|
+
lastPosition?: number;
|
|
79
|
+
/** Share watched, 0 to 100 (union of segments divided by duration); null without a duration or before any watching; absent on older servers */
|
|
80
|
+
coveredPercent?: number | null;
|
|
81
|
+
}
|
|
82
|
+
/** Author or instructor (a site-wide list, the same one as post authors); `avatar` is a URL ready to display */
|
|
83
|
+
interface DeliverableAuthorView {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
/** Title (for example "Senior chef") */
|
|
87
|
+
title: string | null;
|
|
88
|
+
avatar: string | null;
|
|
89
|
+
bio: string | null;
|
|
90
|
+
url: string | null;
|
|
91
|
+
}
|
|
92
|
+
interface CustomerDeliverableTree {
|
|
93
|
+
id: string;
|
|
94
|
+
title: string;
|
|
95
|
+
description: string | null;
|
|
96
|
+
structure: "COURSE" | "DOWNLOAD";
|
|
97
|
+
coverAssetId: string | null;
|
|
98
|
+
cover: DeliverableCover | null;
|
|
99
|
+
/** In the owner's order; absent on older servers */
|
|
100
|
+
authors?: DeliverableAuthorView[];
|
|
101
|
+
settings: {
|
|
102
|
+
completionRule: {
|
|
103
|
+
type: "all_units";
|
|
104
|
+
} | {
|
|
105
|
+
type: "percent";
|
|
106
|
+
percent: number;
|
|
107
|
+
} | {
|
|
108
|
+
type: "quiz_passed";
|
|
109
|
+
unitId: string;
|
|
110
|
+
};
|
|
111
|
+
certificate: {
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
title: string | null;
|
|
114
|
+
signatureName: string | null;
|
|
115
|
+
signatureTitle?: string | null;
|
|
116
|
+
signatureAssetId?: string | null;
|
|
117
|
+
showLogo?: boolean;
|
|
118
|
+
note?: string | null;
|
|
119
|
+
/** Both fields are absent on older servers */
|
|
120
|
+
backgroundAssetId?: string | null;
|
|
121
|
+
backgroundOverlay?: boolean;
|
|
122
|
+
};
|
|
123
|
+
comments: {
|
|
124
|
+
enabled: boolean;
|
|
125
|
+
threaded: boolean;
|
|
126
|
+
requireReview: boolean;
|
|
127
|
+
reactions: boolean;
|
|
128
|
+
};
|
|
129
|
+
requireSequential: boolean;
|
|
130
|
+
/** Share of an audio or video unit that counts as complete (50 to 100, default 90); absent on older servers */
|
|
131
|
+
mediaCompletionPercent?: number;
|
|
132
|
+
};
|
|
133
|
+
units: CustomerUnitView[];
|
|
134
|
+
progress: {
|
|
135
|
+
percent: number;
|
|
136
|
+
completed: boolean;
|
|
137
|
+
completedAt?: string | null;
|
|
138
|
+
} | null;
|
|
139
|
+
/** Completion certificate: `enabled` exists only when the course offers one; after completion `serial` and `issuedAt` are set, and `getCertificate` returns the download URL. Absent on older servers */
|
|
140
|
+
certificate?: {
|
|
141
|
+
enabled: boolean;
|
|
142
|
+
serial: string | null;
|
|
143
|
+
issuedAt: string | null;
|
|
144
|
+
} | null;
|
|
145
|
+
}
|
|
146
|
+
/** The public outline from the Delivery API (anonymous; no private URLs and no body): used by the curriculum section on product pages and by `/api/v1/products` */
|
|
147
|
+
interface PublicDeliverableOutline {
|
|
148
|
+
id: string;
|
|
149
|
+
title: string;
|
|
150
|
+
description: string | null;
|
|
151
|
+
structure: "COURSE" | "DOWNLOAD";
|
|
152
|
+
coverAssetId: string | null;
|
|
153
|
+
cover: DeliverableCover | null;
|
|
154
|
+
/** Authors or instructors, in the owner's order; absent on older servers */
|
|
155
|
+
authors?: DeliverableAuthorView[];
|
|
156
|
+
unitCount: number;
|
|
157
|
+
/** Total unit duration (seconds; audio and video with a duration only); null without durations */
|
|
158
|
+
totalDurationSeconds: number | null;
|
|
159
|
+
units: Array<{
|
|
160
|
+
id: string;
|
|
161
|
+
parentId: string | null;
|
|
162
|
+
order: number;
|
|
163
|
+
kind: string;
|
|
164
|
+
title: string | null;
|
|
165
|
+
description: string | null;
|
|
166
|
+
isPreview: boolean;
|
|
167
|
+
/** Counts toward completion (false means optional); absent on older servers */
|
|
168
|
+
countsTowardCompletion?: boolean;
|
|
169
|
+
/** Scheduled release (ISO 8601); a preview unit cannot be played before then, and the outline should show the release time instead of a preview button */
|
|
170
|
+
releaseAt: string | null;
|
|
171
|
+
duration: number | null;
|
|
172
|
+
pageCount: number | null;
|
|
173
|
+
}>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type { CustomerDeliverableTree as C, PublicDeliverableOutline as P, CustomerUnitView as a };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanorio/elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Kanorio's protected media players, lightbox, curriculum, customer login and analytics as React components and Web Components for Headless sites.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -37,6 +37,50 @@
|
|
|
37
37
|
"types": "./dist/index.d.ts",
|
|
38
38
|
"import": "./dist/index.js"
|
|
39
39
|
},
|
|
40
|
+
"./account": {
|
|
41
|
+
"types": "./dist/account.d.ts",
|
|
42
|
+
"import": "./dist/account.js"
|
|
43
|
+
},
|
|
44
|
+
"./analytics": {
|
|
45
|
+
"types": "./dist/analytics.d.ts",
|
|
46
|
+
"import": "./dist/analytics.js"
|
|
47
|
+
},
|
|
48
|
+
"./bot-protection": {
|
|
49
|
+
"types": "./dist/bot-protection.d.ts",
|
|
50
|
+
"import": "./dist/bot-protection.js"
|
|
51
|
+
},
|
|
52
|
+
"./curriculum": {
|
|
53
|
+
"types": "./dist/curriculum.d.ts",
|
|
54
|
+
"import": "./dist/curriculum.js"
|
|
55
|
+
},
|
|
56
|
+
"./form": {
|
|
57
|
+
"types": "./dist/form.d.ts",
|
|
58
|
+
"import": "./dist/form.js"
|
|
59
|
+
},
|
|
60
|
+
"./lightbox": {
|
|
61
|
+
"types": "./dist/lightbox.d.ts",
|
|
62
|
+
"import": "./dist/lightbox.js"
|
|
63
|
+
},
|
|
64
|
+
"./login": {
|
|
65
|
+
"types": "./dist/login.d.ts",
|
|
66
|
+
"import": "./dist/login.js"
|
|
67
|
+
},
|
|
68
|
+
"./media": {
|
|
69
|
+
"types": "./dist/media.d.ts",
|
|
70
|
+
"import": "./dist/media.js"
|
|
71
|
+
},
|
|
72
|
+
"./provider": {
|
|
73
|
+
"types": "./dist/provider.d.ts",
|
|
74
|
+
"import": "./dist/provider.js"
|
|
75
|
+
},
|
|
76
|
+
"./reviews": {
|
|
77
|
+
"types": "./dist/reviews.d.ts",
|
|
78
|
+
"import": "./dist/reviews.js"
|
|
79
|
+
},
|
|
80
|
+
"./unit": {
|
|
81
|
+
"types": "./dist/unit.d.ts",
|
|
82
|
+
"import": "./dist/unit.js"
|
|
83
|
+
},
|
|
40
84
|
"./web-components": {
|
|
41
85
|
"types": "./dist/web-components.d.ts",
|
|
42
86
|
"import": "./dist/web-components.js"
|
|
@@ -60,7 +104,7 @@
|
|
|
60
104
|
},
|
|
61
105
|
"dependencies": {
|
|
62
106
|
"zod": "^4.3.5",
|
|
63
|
-
"@kanorio/sdk": "1.
|
|
107
|
+
"@kanorio/sdk": "1.2.0"
|
|
64
108
|
},
|
|
65
109
|
"devDependencies": {
|
|
66
110
|
"@tailwindcss/cli": "^4.1.18",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";import{e as a}from"./chunk-UBMXRFSK.js";import"./chunk-DXTWCLOM.js";import"./chunk-V4OWPVBD.js";import"./chunk-JZXJO62T.js";import"./chunk-S4ZA2INU.js";import"./chunk-6LGTFWQS.js";import"./chunk-CDG7S4P5.js";export{a as MediaPlayer};
|
|
2
|
-
//# sourceMappingURL=MediaPlayer-7IBSXL7Q.js.map
|