@coxwave/tap-sdk 0.0.8 → 0.0.10
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 +33 -6
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +82 -53
- package/dist/index.d.ts +82 -53
- package/dist/index.global.js +8 -4
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,13 +22,12 @@ const sdk = new TapSDK({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
await sdk.init({
|
|
25
|
+
buttonId: "tap-button", // ID of the HTML element to attach the toggle button to
|
|
25
26
|
course: {
|
|
26
27
|
userId: "user-123",
|
|
27
28
|
courseId: "course-456",
|
|
28
29
|
clipId: null,
|
|
29
|
-
// clipPlayHead can be provided if it exists in your integration contract
|
|
30
30
|
},
|
|
31
|
-
buttonId: "tap-button",
|
|
32
31
|
customStyles: {
|
|
33
32
|
chatBody: {
|
|
34
33
|
position: { top: "64px", right: "32px" },
|
|
@@ -73,9 +72,9 @@ EduTap can send rich alarm notifications and HTML pop-ups over the iframe channe
|
|
|
73
72
|
|
|
74
73
|
Initializes the iframe, performs the handshake, and wires up UI controls. Required options:
|
|
75
74
|
|
|
76
|
-
- `
|
|
77
|
-
- `
|
|
78
|
-
- `
|
|
75
|
+
- `buttonId` – string (required) - ID of the HTML element to attach the toggle button to
|
|
76
|
+
- `course` – minimal course context (`userId`, `courseId`, `clipId`)
|
|
77
|
+
- `customStyles?` – `{ chatBody? }` - optional UI customization
|
|
79
78
|
|
|
80
79
|
### `events.seekTimeline({ clipId, clipPlayHead })`
|
|
81
80
|
|
|
@@ -94,12 +93,17 @@ Unhooks all listeners, removes the iframe and toggle button decorations, and res
|
|
|
94
93
|
Events are exposed via the `sdk.events` helper. Every listener returns an unsubscribe function.
|
|
95
94
|
|
|
96
95
|
```ts
|
|
96
|
+
// Chat lifecycle events
|
|
97
|
+
sdk.events.onChatInitiated(() => console.log("chat initialized"));
|
|
97
98
|
sdk.events.onChatOpened(() => console.log("chat opened"));
|
|
98
99
|
sdk.events.onChatClosed(() => console.log("chat closed"));
|
|
100
|
+
|
|
101
|
+
// Timeline synchronization
|
|
99
102
|
sdk.events.onTimelineSeek((playHead, clipId) => {
|
|
100
103
|
console.log("EduTap requested timeline seek", playHead, clipId);
|
|
101
104
|
});
|
|
102
105
|
|
|
106
|
+
// Notifications and overlays
|
|
103
107
|
sdk.events.onAlarmFadeIn((alarm) => {
|
|
104
108
|
console.log("Alarm", alarm.message);
|
|
105
109
|
});
|
|
@@ -136,7 +140,30 @@ All message contracts are sourced from `@coxwave/tap-messages` and validated wit
|
|
|
136
140
|
|
|
137
141
|
MIT © 2025 Coxwave
|
|
138
142
|
|
|
143
|
+
## Properties
|
|
144
|
+
|
|
145
|
+
### `isOpen`
|
|
146
|
+
|
|
147
|
+
Returns `true` if the chat interface is currently open.
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
if (sdk.isOpen) {
|
|
151
|
+
console.log("Chat is currently open");
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `isInitialized`
|
|
156
|
+
|
|
157
|
+
Returns `true` if the SDK has been successfully initialized.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
if (sdk.isInitialized) {
|
|
161
|
+
console.log("SDK is ready to use");
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
139
165
|
## Deprecated helpers
|
|
140
166
|
|
|
167
|
+
- `initChat(options)` – use `init(options)` instead; scheduled for removal in v1.0.0
|
|
141
168
|
- `postChatInfo({ clipId, clipPlayHead })` – alias for `events.seekTimeline`; scheduled for removal in v1.0.0
|
|
142
|
-
- `getTimelineInfo({ callback })` – use `sdk.events.onTimelineSeek` instead
|
|
169
|
+
- `getTimelineInfo({ callback })` – use `sdk.events.onTimelineSeek` instead; scheduled for removal in v1.0.0
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@keyframes
|
|
1
|
+
@keyframes _16e62km0{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}@keyframes _16e62km1{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(30px);display:none}}._16e62km2{opacity:0;transform:translateY(30px);transition:opacity .4s ease,transform .4s ease;pointer-events:none;display:none}._16e62km3{animation:_16e62km0 .4s ease forwards;pointer-events:auto}._16e62km4{animation:_16e62km1 .4s ease forwards;pointer-events:none}._16e62km5{border:none!important}@keyframes wtjce00{0%{opacity:1;pointer-events:auto}50%{opacity:1}to{opacity:0}}.wtjce01{pointer-events:none;opacity:0;display:flex;position:absolute;width:max-content;top:calc(100% + 5px);right:0;flex-direction:column;justify-content:center;align-items:flex-end;padding-top:2px;cursor:pointer;z-index:999;transition:opacity .3s ease}.wtjce02{pointer-events:auto;animation:wtjce00 18s forwards}.wtjce03{opacity:0;pointer-events:none;animation:none}.wtjce04{display:flex;justify-content:flex-end;border-radius:var(--Radius-radiusSM, 8px);width:max-content;gap:5px}.wtjce05{display:flex;padding:8px 12px 6px;justify-content:flex-end;align-items:center;border-radius:var(--Radius-radiusSM, 8px);max-width:340px}.wtjce06{background-color:#171b1f}.wtjce07{background-color:#fa6b4b}.wtjce08{color:#fff;text-align:right;font-family:Pretendard;font-size:14px;font-style:normal;font-weight:400;line-height:20px;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word}.wtjce09{display:flex;padding:0 23px;align-items:flex-start;gap:10px}.wtjce0a{width:15px}.wtjce0b{color:#171b1f}.wtjce0c{color:#fa6b4b}.wtjce0d{cursor:pointer;justify-content:center;align-items:center;width:20px;height:20px;border-radius:100px;z-index:999;transition:all .2s ease}.wtjce0d:hover{width:63px;left:-72px}.wtjce04:hover .wtjce0d{display:flex}.wtjce0e,.wtjce0f{display:none;background-color:#171b1f}.wtjce0g{color:#fff}.wtjce0d:hover .wtjce0g{display:none}.wtjce0h{color:#fff;text-align:center;font-family:Pretendard;font-size:12px;font-style:normal;font-weight:400;line-height:20px;display:none}.wtjce0d:hover .wtjce0h{display:block}._1mnmljf0{width:100%;min-width:max-content;table-layout:auto;border-collapse:separate;border-spacing:0;border:.4px solid rgba(118,118,128,.12);border-radius:8px;overflow:auto;background-color:#fff;cursor:pointer}._1mnmljf1{border:.4px solid rgba(118,118,128,.12);padding:10px;background-color:#f2f2f2;text-align:left;font-family:Pretendard;color:#090909;font-size:12px;font-weight:500;white-space:normal;overflow-wrap:break-word;word-break:break-word}._1mnmljf2{border:.4px solid rgba(118,118,128,.12);padding:10px;color:#090909;font-family:Pretendard;font-size:12px;font-weight:400;width:fit-content;max-width:400px;white-space:normal;overflow-wrap:break-word;word-break:break-word}._1mnmljf3{position:relative;background-color:#fafafa;border-radius:8px;padding:8px;overflow-y:auto}._1mnmljf4{display:flex;align-items:center;justify-content:space-between;padding-bottom:4px}._1mnmljf5{color:#4a5568;padding:2px 6px;font-size:12px;border-radius:4px;z-index:10;font-family:Pretendard}._1mnmljf6{z-index:10;cursor:pointer;display:flex;align-items:center;width:max-content;color:#4a5568;padding:2px 6px;font-size:12px;border:none;font-family:Pretendard}._1mnmljf7{white-space:nowrap}._1mnmljf8{display:flex;width:12px;height:12px;margin-bottom:4px;color:#4a5568;flex-shrink:0}._1mnmljf9{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0006;z-index:10000002}._1mnmljfa{position:fixed;display:flex;flex-direction:column;width:max-content;max-width:calc(100vw - 100px);overflow:auto;background:#fff;padding:20px;border:1px solid #ccc;box-shadow:0 4px 20px #0003;z-index:10000003;border-radius:8px}
|
|
2
2
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vanilla-extract-css-ns:chatBody/chatBody.css.ts.vanilla.css?source=QGtleWZyYW1lcyBfMW1sdjRtZTAgewogIGZyb20gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9Cn0KQGtleWZyYW1lcyBfMW1sdjRtZTEgewogIGZyb20gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICAgIGRpc3BsYXk6IG5vbmU7CiAgfQp9Ci5fMW1sdjRtZTIgewogIG9wYWNpdHk6IDA7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVZKDMwcHgpOwogIHRyYW5zaXRpb246IG9wYWNpdHkgMC40cyBlYXNlLCB0cmFuc2Zvcm0gMC40cyBlYXNlOwogIHBvaW50ZXItZXZlbnRzOiBub25lOwogIGRpc3BsYXk6IG5vbmU7Cn0KLl8xbWx2NG1lMyB7CiAgYW5pbWF0aW9uOiBfMW1sdjRtZTAgMC40cyBlYXNlIGZvcndhcmRzOwogIHBvaW50ZXItZXZlbnRzOiBhdXRvOwp9Ci5fMW1sdjRtZTQgewogIGFuaW1hdGlvbjogXzFtbHY0bWUxIDAuNHMgZWFzZSBmb3J3YXJkczsKICBwb2ludGVyLWV2ZW50czogbm9uZTsKfQouXzFtbHY0bWU1IHsKICBib3JkZXI6IG5vbmUgIWltcG9ydGFudDsKfQ==","vanilla-extract-css-ns:ui/button/alarm/styles/alarm.css.ts.vanilla.css?source=#H4sIAAAAAAAAE61UwW7bMAy95ysIDAM6rCpsJ00b5bL10NuAYfsCxaJjNbJkSHLtdOi/D5LtxI6TtRt2SsxHUo/vUfqyw31mWIEWaveUYhTBrxlA9DH8AOiSpcLtKcTr8F1qoRwags+onKXAKqc98joDuL1Q5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9TMryqYkUJHdlsYafhi8rh4AmXolEMJNZRzVorT2reCnll8MWiR1VxW0W20wH0c/iWxU48I4MkHQFjqEfRnD2DI43K9mfhMaqNDJS2LZdrpUhvuWFQWOQX0usRLPxJDN1mFoXSf6TQL6raluB3BWdTwaNRa+HXRg2+nTIZndD/izQfozRGO+GFVgwsSu7FE24bwjbFQ3qke5iHV8y9qHdndnKd7b6QyCKJSjgj+ZVBLTHuiHYjwmPrGJQ42h7ga+e8qK+zXAyiJKRA3yOqFTQptPe6ZZAFBgvaMaLNvcz48XjKbwinZoDTqmO3TbyrNhujz0SoCofglVd9sbA4RRZ323665G9XZfvB+8sqg88Uvq2gT+NTfGvS4MnVmny70fP7PWGfpxsyz1tuG6Fuu7lVWjiOuLMV6hLf6ZfvG7kHlyUGAAA="],"sourcesContent":["@keyframes _1mlv4me0 {\n from {\n opacity: 0;\n transform: translateY(30px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n@keyframes _1mlv4me1 {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(30px);\n display: none;\n }\n}\n._1mlv4me2 {\n opacity: 0;\n transform: translateY(30px);\n transition: opacity 0.4s ease, transform 0.4s ease;\n pointer-events: none;\n display: none;\n}\n._1mlv4me3 {\n animation: _1mlv4me0 0.4s ease forwards;\n pointer-events: auto;\n}\n._1mlv4me4 {\n animation: _1mlv4me1 0.4s ease forwards;\n pointer-events: none;\n}\n._1mlv4me5 {\n border: none !important;\n}","@keyframes wtjce00 {\n 0% {\n opacity: 1;\n pointer-events: auto;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n.wtjce01 {\n pointer-events: none;\n opacity: 0;\n display: flex;\n position: absolute;\n width: max-content;\n top: calc(100% + 5px);\n right: 0;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n padding-top: 2px;\n cursor: pointer;\n z-index: 999;\n transition: opacity 0.3s ease;\n}\n.wtjce02 {\n pointer-events: auto;\n animation: wtjce00 18s forwards;\n}\n.wtjce03 {\n opacity: 0;\n pointer-events: none;\n animation: none;\n}\n.wtjce04 {\n display: flex;\n justify-content: flex-end;\n border-radius: var(--Radius-radiusSM, 8px);\n width: max-content;\n gap: 5px;\n}\n.wtjce05 {\n display: flex;\n padding: 8px 12px 6px 12px;\n justify-content: flex-end;\n align-items: center;\n border-radius: var(--Radius-radiusSM, 8px);\n max-width: 340px;\n}\n.wtjce06 {\n background-color: #171B1F;\n}\n.wtjce07 {\n background-color: #FA6B4B;\n}\n.wtjce08 {\n color: #fff;\n text-align: right;\n font-family: Pretendard;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n white-space: pre-wrap;\n word-break: keep-all;\n overflow-wrap: break-word;\n}\n.wtjce09 {\n display: flex;\n padding: 0px 23px;\n align-items: flex-start;\n gap: 10px;\n}\n.wtjce0a {\n width: 15px;\n}\n.wtjce0b {\n color: #171B1F;\n}\n.wtjce0c {\n color: #FA6B4B;\n}\n.wtjce0d {\n cursor: pointer;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100px;\n z-index: 999;\n transition: all 0.2s ease;\n}\n.wtjce0d:hover {\n width: 63px;\n left: -72px;\n}\n.wtjce04:hover .wtjce0d {\n display: flex;\n}\n.wtjce0e {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0f {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0g {\n color: white;\n}\n.wtjce0d:hover .wtjce0g {\n display: none;\n}\n.wtjce0h {\n color: #fff;\n text-align: center;\n font-family: Pretendard;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n display: none;\n}\n.wtjce0d:hover .wtjce0h {\n display: block;\n}",".wu2gm60 {\n width: 100%;\n min-width: max-content;\n table-layout: auto;\n border-collapse: separate;\n border-spacing: 0;\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n border-radius: 8px;\n overflow: auto;\n background-color: #fff;\n cursor: pointer;\n}\n.wu2gm61 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n background-color: #f2f2f2;\n text-align: left;\n font-family: Pretendard;\n color: #090909;\n font-size: 12px;\n font-weight: 500;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n.wu2gm62 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n color: #090909;\n font-family: Pretendard;\n font-size: 12px;\n font-weight: 400;\n width: fit-content;\n max-width: 400px;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n.wu2gm63 {\n position: relative;\n background-color: rgb(250, 250, 250);\n border-radius: 8px;\n padding: 8px;\n overflow-y: auto;\n}\n.wu2gm64 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 4px;\n}\n.wu2gm65 {\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border-radius: 4px;\n z-index: 10;\n font-family: Pretendard;\n}\n.wu2gm66 {\n z-index: 10;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: max-content;\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border: none;\n font-family: Pretendard;\n}\n.wu2gm67 {\n white-space: nowrap;\n}\n.wu2gm68 {\n display: flex;\n width: 12px;\n height: 12px;\n margin-bottom: 4px;\n color: #4a5568;\n flex-shrink: 0;\n}"],"mappings":"AAAA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,KACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACF,CACA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,MACtB,QAAS,IACX,CACF,CACA,CAAC,UACC,QAAS,EACT,UAAW,WAAW,MACtB,WAAY,QAAQ,IAAK,IAAI,CAAE,UAAU,IAAK,KAC9C,eAAgB,KAChB,QAAS,IACX,CACA,CAAC,UACC,UAAW,UAAU,IAAK,KAAK,SAC/B,eAAgB,IAClB,CACA,CAAC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I,IACb,UAAW,KACX,OAAQ,KACR,YAAa,UACf,CACA,CAAC,QACC,YAAa,MACf,CACA,CAAC,QACC,QAAS,KACT,MAAO,KACP,OAAQ,KACR,cAAe,IACf,MAAO,QACP,YAAa,CACf","names":[]}
|
|
1
|
+
{"version":3,"sources":["vanilla-extract-css-ns:ui/container/container.css.ts.vanilla.css?source=QGtleWZyYW1lcyBfMTZlNjJrbTAgewogIGZyb20gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9Cn0KQGtleWZyYW1lcyBfMTZlNjJrbTEgewogIGZyb20gewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgwKTsKICB9CiAgdG8gewogICAgb3BhY2l0eTogMDsKICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgzMHB4KTsKICAgIGRpc3BsYXk6IG5vbmU7CiAgfQp9Ci5fMTZlNjJrbTIgewogIG9wYWNpdHk6IDA7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVZKDMwcHgpOwogIHRyYW5zaXRpb246IG9wYWNpdHkgMC40cyBlYXNlLCB0cmFuc2Zvcm0gMC40cyBlYXNlOwogIHBvaW50ZXItZXZlbnRzOiBub25lOwogIGRpc3BsYXk6IG5vbmU7Cn0KLl8xNmU2MmttMyB7CiAgYW5pbWF0aW9uOiBfMTZlNjJrbTAgMC40cyBlYXNlIGZvcndhcmRzOwogIHBvaW50ZXItZXZlbnRzOiBhdXRvOwp9Ci5fMTZlNjJrbTQgewogIGFuaW1hdGlvbjogXzE2ZTYya20xIDAuNHMgZWFzZSBmb3J3YXJkczsKICBwb2ludGVyLWV2ZW50czogbm9uZTsKfQouXzE2ZTYya201IHsKICBib3JkZXI6IG5vbmUgIWltcG9ydGFudDsKfQ==","vanilla-extract-css-ns:ui/button/alarm/styles/alarm.css.ts.vanilla.css?source=#H4sIAAAAAAAAE61UwW7bMAy95ysIDAM6rCpsJ00b5bL10NuAYfsCxaJjNbJkSHLtdOi/D5LtxI6TtRt2SsxHUo/vUfqyw31mWIEWaveUYhTBrxlA9DH8AOiSpcLtKcTr8F1qoRwags+onKXAKqc98joDuL1Q5bE4moJRC77Obtqj45BweoLSCn3iuIwLW0q2p5BJbNahzAontKLANlbLyoWiWnCXUyhYQ1KtHCrno06XFFIm06tA6zPcls0nDxixzV13gm9MuDCYtm1TLatCeeSpsk5k+74jhRQ9Yw8xKbaKCIeFbakRVDzQY5wLtSXh6KQMlNPKWG1oP7EPvRChODYUVqtVYGqY6ufqBIDoZm4BmcX1UbrkrHS9OUyJgrVNepPjewuZNjUz3A76zEOfsdSXDBl0bUOHLovQZWLRRLehQBttOBpiGBeVpfDMzBUhP8JXF/z57RruO6PO+7plJfVeDqjcnqfS2UF9Q4iTsoFl9+dNoiOLj87/HX9PvJthvohGjJeB8Yalu63RleIk1dJvyYf4Ln6IHweZd5cyH78uHxYPg8z7kNnDWZaF3cLGkTANbRc/bL1WjmSsEHJP4btBh4ozww+QFS9IIV60QrUht5fod8AUTB6iNbZ3aRGFJZJCIcm7WBK15XUuHBJbshQplAZJbVgZAG042RhkOwo7xJIwGTrrZzSZ1HVIpBAyiE8ezLp6w/GobCCZtwSm19U6Zo67FI+tYaF151s8XrTNSOKJV+kInhjEW3j6ILz3rTmGO3q9xqean+xpHHXxP708TEqIbpLJq8Np7h0ZqrLslJWYOQrkLhmJtOgKRlOfWHVIxjHaPzvvuRnZv5duh0aFBT0z8Cj35JhDcv7WpTt69s5bl/yXW3eJ78lw+Xi4jdTpbj17/Q1FleMxMQgAAA==","vanilla-extract-css-ns:ui/popup/popup.css.ts.vanilla.css?source=#H4sIAAAAAAAAE7VV4W6bMBD+n6c4qZrUSnFkKMlS9yX2BpOBg7g1tmVMIJ367pMNNJCSttO2OCLhzvZ9993n8+ZnVKlKPhUUfq0AWpG7A4OI0m+PK4BKKDKYKt6RTCuHynmP46lEIvlJN44Bb5z21lTbHC3JtJTc1MigRsMtdzhx1oZnQpUM6NnIgG4S00GtpcjBlim/jaL9GvpHvF8D3UTx3WQXy3PR1Az2pvNWfURbSN1OoPDsubS6UbmHoy2Dm6IovCdrbO3fjRbKoX1cva42IwtRYOGPQRme5yGniPZ4lqLHfgTusHOES1EqBhKLwGehlSMFr4Q8Mfhh0aHKuc0D3mED+uDH2+RavCCDKO4DBlOLojw4BlsauG0PwmHgGxkobSsup1yR1nLDILXIn0mr+2D+lwTT3DPhKP5HHF3Ja5mEz1JOhpR7sRbCTcXqtTt4EjpE/0/k3AdyjK6FE1oxsCi5E0dcFoUt09t4S9cwPj6Q+Bt/F5Inp1H0ExhJgJGL2kh+YlBIDGuC6IhwWNUMMuzlD/DU1E4Up5EyBoEWkqJrEdUkOEm1c7pikHgMk3jbEG+saMK3291+Bjo2HewmdZuX8iLjpLe+EKFy7LxiPlTHBMcu4LhY+O7Af52Z5eb3l3l6vSn8akrf+8Y8l6tX52zWfrngYz8f4h+G0zK+V9yWQs2rupSe347UByvUc+jbk8APF4IvRIfhsDhthh7ve9zw93y/HNsZIEqPh/kZYX07oWsYvpvk7kIV4RPP4PBrcN5RE3LKhcWsn5lp2VTqetEnTSTjMrsNOQDxMEx399kldL5+zlKhc1FEb330Jsuy3uNZ57nfkvrqhDUjL2Fs4kVS7q/1kdffyFbefPEHAAA="],"sourcesContent":["@keyframes _16e62km0 {\n from {\n opacity: 0;\n transform: translateY(30px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n@keyframes _16e62km1 {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(30px);\n display: none;\n }\n}\n._16e62km2 {\n opacity: 0;\n transform: translateY(30px);\n transition: opacity 0.4s ease, transform 0.4s ease;\n pointer-events: none;\n display: none;\n}\n._16e62km3 {\n animation: _16e62km0 0.4s ease forwards;\n pointer-events: auto;\n}\n._16e62km4 {\n animation: _16e62km1 0.4s ease forwards;\n pointer-events: none;\n}\n._16e62km5 {\n border: none !important;\n}","@keyframes wtjce00 {\n 0% {\n opacity: 1;\n pointer-events: auto;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}\n.wtjce01 {\n pointer-events: none;\n opacity: 0;\n display: flex;\n position: absolute;\n width: max-content;\n top: calc(100% + 5px);\n right: 0;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n padding-top: 2px;\n cursor: pointer;\n z-index: 999;\n transition: opacity 0.3s ease;\n}\n.wtjce02 {\n pointer-events: auto;\n animation: wtjce00 18s forwards;\n}\n.wtjce03 {\n opacity: 0;\n pointer-events: none;\n animation: none;\n}\n.wtjce04 {\n display: flex;\n justify-content: flex-end;\n border-radius: var(--Radius-radiusSM, 8px);\n width: max-content;\n gap: 5px;\n}\n.wtjce05 {\n display: flex;\n padding: 8px 12px 6px 12px;\n justify-content: flex-end;\n align-items: center;\n border-radius: var(--Radius-radiusSM, 8px);\n max-width: 340px;\n}\n.wtjce06 {\n background-color: #171B1F;\n}\n.wtjce07 {\n background-color: #FA6B4B;\n}\n.wtjce08 {\n color: #fff;\n text-align: right;\n font-family: Pretendard;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n white-space: pre-wrap;\n word-break: keep-all;\n overflow-wrap: break-word;\n}\n.wtjce09 {\n display: flex;\n padding: 0px 23px;\n align-items: flex-start;\n gap: 10px;\n}\n.wtjce0a {\n width: 15px;\n}\n.wtjce0b {\n color: #171B1F;\n}\n.wtjce0c {\n color: #FA6B4B;\n}\n.wtjce0d {\n cursor: pointer;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100px;\n z-index: 999;\n transition: all 0.2s ease;\n}\n.wtjce0d:hover {\n width: 63px;\n left: -72px;\n}\n.wtjce04:hover .wtjce0d {\n display: flex;\n}\n.wtjce0e {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0f {\n display: none;\n background-color: #171B1F;\n}\n.wtjce0g {\n color: white;\n}\n.wtjce0d:hover .wtjce0g {\n display: none;\n}\n.wtjce0h {\n color: #fff;\n text-align: center;\n font-family: Pretendard;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n display: none;\n}\n.wtjce0d:hover .wtjce0h {\n display: block;\n}","._1mnmljf0 {\n width: 100%;\n min-width: max-content;\n table-layout: auto;\n border-collapse: separate;\n border-spacing: 0;\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n border-radius: 8px;\n overflow: auto;\n background-color: #fff;\n cursor: pointer;\n}\n._1mnmljf1 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n background-color: #f2f2f2;\n text-align: left;\n font-family: Pretendard;\n color: #090909;\n font-size: 12px;\n font-weight: 500;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n._1mnmljf2 {\n border: 0.4px solid rgba(118, 118, 128, 0.12);\n padding: 10px;\n color: #090909;\n font-family: Pretendard;\n font-size: 12px;\n font-weight: 400;\n width: fit-content;\n max-width: 400px;\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n}\n._1mnmljf3 {\n position: relative;\n background-color: rgb(250, 250, 250);\n border-radius: 8px;\n padding: 8px;\n overflow-y: auto;\n}\n._1mnmljf4 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 4px;\n}\n._1mnmljf5 {\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border-radius: 4px;\n z-index: 10;\n font-family: Pretendard;\n}\n._1mnmljf6 {\n z-index: 10;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: max-content;\n color: #4a5568;\n padding: 2px 6px;\n font-size: 12px;\n border: none;\n font-family: Pretendard;\n}\n._1mnmljf7 {\n white-space: nowrap;\n}\n._1mnmljf8 {\n display: flex;\n width: 12px;\n height: 12px;\n margin-bottom: 4px;\n color: #4a5568;\n flex-shrink: 0;\n}\n._1mnmljf9 {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: rgba(0, 0, 0, 0.4);\n z-index: 10000002;\n}\n._1mnmljfa {\n position: fixed;\n display: flex;\n flex-direction: column;\n width: max-content;\n max-width: calc(100vw - 100px);\n overflow: auto;\n background: #fff;\n padding: 20px;\n border: 1px solid #ccc;\n box-shadow: 0 4px 20px rgba(0,0,0,0.2);\n z-index: 10000003;\n border-radius: 8px;\n}"],"mappings":"AAAA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,KACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACF,CACA,WAAW,UACT,GACE,QAAS,EACT,UAAW,WAAW,EACxB,CACA,GACE,QAAS,EACT,UAAW,WAAW,MACtB,QAAS,IACX,CACF,CACA,CAAC,UACC,QAAS,EACT,UAAW,WAAW,MACtB,WAAY,QAAQ,IAAK,IAAI,CAAE,UAAU,IAAK,KAC9C,eAAgB,KAChB,QAAS,IACX,CACA,CAAC,UACC,UAAW,UAAU,IAAK,KAAK,SAC/B,eAAgB,IAClB,CACA,CAAC,UACC,UAAW,UAAU,IAAK,KAAK,SAC/B,eAAgB,IAClB,CACA,CAAC,UACC,OAAQ,cACV,CCtCA,WAAW,QACT,GACE,QAAS,EACT,eAAgB,IAClB,CACA,IACE,QAAS,CACX,CACA,GACE,QAAS,CACX,CACF,CACA,CAAC,QACC,eAAgB,KAChB,QAAS,EACT,QAAS,KACT,SAAU,SACV,MAAO,YACP,IAAK,KAAK,KAAK,EAAE,KACjB,MAAO,EACP,eAAgB,OAChB,gBAAiB,OACjB,YAAa,SACb,YAAa,IACb,OAAQ,QACR,QAAS,IACT,WAAY,QAAQ,IAAK,IAC3B,CACA,CAAC,QACC,eAAgB,KAChB,UAAW,QAAQ,IAAI,QACzB,CACA,CAAC,QACC,QAAS,EACT,eAAgB,KAChB,UAAW,IACb,CACA,CAAC,QACC,QAAS,KACT,gBAAiB,SACjB,cAAe,IAAI,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AAK,GAAG,CAAE,GAAG,CAAE,GAAG,CAAE,KAb1C,QAcW,KACT,iBAAkB,QAClB,WAAY,KACZ,YAAa,WACb,MAAO,QACP,UAAW,KACX,YAAa,IACb,YAAa,OACb,cAAe,WACf,WAAY,UACd,CACA,CAAC,UACC,OAAQ,KAAM,MAAM,KAAK,GAAG,CAAE,GAAG,CAAE,GAAG,CAAE,KA1B1C,QA2BW,KACT,MAAO,QACP,YAAa,WACb,UAAW,KACX,YAAa,IACb,MAAO,YACP,UAAW,MACX,YAAa,OACb,cAAe,WACf,WAAY,UACd,CACA,CAAC,UACC,SAAU,SACV,iBAAkB,QAxCpB,cAyCiB,IAzCjB,QA0CW,IACT,WAAY,IACd,CACA,CAAC,UACC,QAAS,KACT,YAAa,OACb,gBAAiB,cACjB,eAAgB,GAClB,CACA,CAAC,UACC,MAAO,QApDT,QAqDW,IAAI,IACb,UAAW,KAtDb,cAuDiB,IACf,QAAS,GACT,YAAa,UACf,CACA,CAAC,UACC,QAAS,GACT,OAAQ,QACR,QAAS,KACT,YAAa,OACb,MAAO,YACP,MAAO,QAjET,QAkEW,IAAI,IACb,UAAW,KACX,OAAQ,KACR,YAAa,UACf,CACA,CAAC,UACC,YAAa,MACf,CACA,CAAC,UACC,QAAS,KACT,MAAO,KACP,OAAQ,KACR,cAAe,IACf,MAAO,QACP,YAAa,CACf,CACA,CAAC,UACC,SAAU,MACV,IAAK,EACL,KAAM,EACN,MAAO,MACP,OAAQ,MACR,WAAY,MACZ,QAAS,QACX,CACA,CAAC,UACC,SAAU,MACV,QAAS,KACT,eAAgB,OAChB,MAAO,YACP,UAAW,KAAK,MAAM,EAAE,OACxB,SAAU,KACV,WAAY,KAlGd,QAmGW,KACT,OAAQ,IAAI,MAAM,KAClB,WAAY,EAAE,IAAI,KAAK,MACvB,QAAS,SAtGX,cAuGiB,GACjB","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -25,21 +25,74 @@ interface HandshakeOptions {
|
|
|
25
25
|
retryInterval?: number;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
interface LogEvent {
|
|
29
|
+
action: string;
|
|
30
|
+
category: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
value?: number;
|
|
33
|
+
customParams?: Record<string, any>;
|
|
34
|
+
}
|
|
35
|
+
interface EventMiddleware {
|
|
36
|
+
handle(event: LogEvent): void;
|
|
37
|
+
}
|
|
38
|
+
declare class EventLogger {
|
|
39
|
+
private middlewares;
|
|
40
|
+
addMiddleware(middleware: EventMiddleware): void;
|
|
41
|
+
removeMiddleware(middleware: EventMiddleware): void;
|
|
42
|
+
log(event: LogEvent): void;
|
|
43
|
+
logChatAction(action: "opened" | "closed" | "initialized", customParams?: Record<string, any>): void;
|
|
44
|
+
logButtonClick(buttonType: "toggle" | "alarm", state?: string, customParams?: Record<string, any>): void;
|
|
45
|
+
logSDKInitialization(success: boolean, startTime: number, error?: string): void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type TapSDKConfig = {
|
|
49
|
+
apiKey: string;
|
|
50
|
+
};
|
|
51
|
+
type TapSDKInitParams = {
|
|
52
|
+
buttonId: string;
|
|
53
|
+
course: Course;
|
|
54
|
+
container?: ContainerStyle;
|
|
55
|
+
};
|
|
56
|
+
type Course = {
|
|
57
|
+
userId: string;
|
|
58
|
+
courseId: string;
|
|
59
|
+
clipId: string;
|
|
60
|
+
clipPlayHead?: number;
|
|
61
|
+
};
|
|
62
|
+
type ContainerStyle = {
|
|
63
|
+
position?: PositionType;
|
|
64
|
+
width?: string;
|
|
65
|
+
height?: string;
|
|
66
|
+
borderRadius?: string;
|
|
67
|
+
};
|
|
68
|
+
type PositionType = {
|
|
69
|
+
top?: string;
|
|
70
|
+
left?: string;
|
|
71
|
+
right?: string;
|
|
72
|
+
bottom?: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
type SeekTimelineParamsType = {
|
|
76
|
+
clipId: string;
|
|
77
|
+
clipPlayHead: number;
|
|
78
|
+
};
|
|
79
|
+
|
|
28
80
|
type ToTapMessage = ChatInitMessage | ChatOpenMessage | ChatCloseMessage | TimelineSeekMessage | AlarmClickMessage | PopUpCloseMessage | PdfEnlargedMessage | PdfShrinkedMessage;
|
|
29
81
|
type FromTapMessage = ChatInitiatedMessage | ChatOpenedMessage | ChatClosedMessage | AlarmFadeInMessage | PopUpOpenMessage | PdfOpenMessage | PdfCloseMessage | TimelineSeekMessage;
|
|
30
82
|
interface ChatInitConfig {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
apiUrl?: string | undefined;
|
|
83
|
+
course: Course;
|
|
84
|
+
container?: ContainerStyle;
|
|
34
85
|
}
|
|
35
86
|
declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
|
|
36
87
|
#private;
|
|
37
88
|
protected hostOrigin: string;
|
|
38
89
|
protected apiKey: string;
|
|
39
90
|
protected iframe: HTMLIFrameElement | null;
|
|
40
|
-
|
|
91
|
+
private eventLogger;
|
|
92
|
+
constructor({ hostOrigin, apiKey, eventLogger, }: {
|
|
41
93
|
hostOrigin: string;
|
|
42
94
|
apiKey: string;
|
|
95
|
+
eventLogger?: EventLogger;
|
|
43
96
|
});
|
|
44
97
|
protected isValidOrigin(_event: MessageEvent): boolean;
|
|
45
98
|
protected getMessageTarget(): Window | null;
|
|
@@ -70,35 +123,6 @@ declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
|
|
|
70
123
|
static defaultHandshakeOptions: HandshakeOptions;
|
|
71
124
|
}
|
|
72
125
|
|
|
73
|
-
type TapSDKConfig = {
|
|
74
|
-
apiKey: string;
|
|
75
|
-
};
|
|
76
|
-
type Course = {
|
|
77
|
-
userId: string;
|
|
78
|
-
courseId: string | null;
|
|
79
|
-
clipId: string | null;
|
|
80
|
-
};
|
|
81
|
-
type CustomStyles = {
|
|
82
|
-
chatBody?: ChatBodyStyle;
|
|
83
|
-
};
|
|
84
|
-
type ChatBodyStyle = {
|
|
85
|
-
position?: PositionType;
|
|
86
|
-
width?: string;
|
|
87
|
-
height?: string;
|
|
88
|
-
borderRadius?: string;
|
|
89
|
-
};
|
|
90
|
-
type PositionType = {
|
|
91
|
-
top?: string;
|
|
92
|
-
left?: string;
|
|
93
|
-
right?: string;
|
|
94
|
-
bottom?: string;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
type SeekTimelineParamsType = {
|
|
98
|
-
clipId: string;
|
|
99
|
-
clipPlayHead: number;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
126
|
declare class EventManager {
|
|
103
127
|
private iframeBridge;
|
|
104
128
|
constructor(iframeBridge: TapIframeBridge);
|
|
@@ -127,16 +151,14 @@ declare class EventManager {
|
|
|
127
151
|
* ```
|
|
128
152
|
*/
|
|
129
153
|
declare class TapSDK {
|
|
130
|
-
#private;
|
|
131
154
|
private apiKey;
|
|
132
155
|
private iframeBridge;
|
|
133
156
|
events: EventManager;
|
|
134
157
|
private eventLogger;
|
|
135
|
-
private
|
|
136
|
-
private chatBodyMaker;
|
|
158
|
+
private container;
|
|
137
159
|
private button;
|
|
138
160
|
private alarm;
|
|
139
|
-
private
|
|
161
|
+
private containerVisible;
|
|
140
162
|
private isPdfOpen;
|
|
141
163
|
private _isInitialized;
|
|
142
164
|
/**
|
|
@@ -147,37 +169,44 @@ declare class TapSDK {
|
|
|
147
169
|
get isOpen(): boolean;
|
|
148
170
|
get isInitialized(): boolean;
|
|
149
171
|
/**
|
|
150
|
-
* Initializes the TapSDK with course data and optional
|
|
172
|
+
* Initializes the TapSDK with course data and optional container styles
|
|
151
173
|
* @param params - Initialization parameters
|
|
152
174
|
* @param params.course - Course information for chat context
|
|
153
|
-
* @param params.
|
|
175
|
+
* @param params.container - Optional container styling options
|
|
154
176
|
* @throws {Error} When initialization fails
|
|
155
177
|
*/
|
|
156
|
-
init({ buttonId, course,
|
|
157
|
-
buttonId: string;
|
|
158
|
-
course: Course;
|
|
159
|
-
customStyles?: CustomStyles;
|
|
160
|
-
}): Promise<void>;
|
|
178
|
+
init({ buttonId, course, container }: TapSDKInitParams): Promise<void>;
|
|
161
179
|
/**
|
|
162
180
|
* Destroys the SDK instance and cleans up all resources
|
|
163
181
|
*/
|
|
164
182
|
destroy(): void;
|
|
165
|
-
private
|
|
166
|
-
private setChatBodyVisible;
|
|
167
|
-
private setIsPdfOpen;
|
|
183
|
+
private setupEventLogger;
|
|
168
184
|
private toggleChatOpen;
|
|
169
185
|
private validateEnvironment;
|
|
170
|
-
private
|
|
186
|
+
private setupContainer;
|
|
187
|
+
private updateContainerStyles;
|
|
171
188
|
private setupButton;
|
|
172
189
|
private setupEventListeners;
|
|
190
|
+
/**
|
|
191
|
+
* Update container styles dynamically
|
|
192
|
+
*/
|
|
193
|
+
updateStyles(container: ContainerStyle): void;
|
|
194
|
+
/**
|
|
195
|
+
* POC: Dynamically set container size
|
|
196
|
+
*/
|
|
197
|
+
setContainerSize(width: string, height: string): void;
|
|
198
|
+
/**
|
|
199
|
+
* POC: Animate container resize
|
|
200
|
+
*/
|
|
201
|
+
animateContainerResize(width: string, height: string, duration?: number): void;
|
|
202
|
+
/**
|
|
203
|
+
* POC: Set responsive mode
|
|
204
|
+
*/
|
|
205
|
+
setResponsiveMode(mode: "compact" | "normal" | "expanded"): void;
|
|
173
206
|
/**
|
|
174
207
|
* @deprecated Use `init` method instead. Will be removed in v1.0.0
|
|
175
208
|
*/
|
|
176
|
-
initChat(params:
|
|
177
|
-
course: Course;
|
|
178
|
-
customStyles?: CustomStyles;
|
|
179
|
-
buttonId: string;
|
|
180
|
-
}): Promise<void>;
|
|
209
|
+
initChat(params: TapSDKInitParams): Promise<void>;
|
|
181
210
|
/**
|
|
182
211
|
* @deprecated Use `events.seekTimeline` method instead. Will be removed in v1.0.0
|
|
183
212
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -25,21 +25,74 @@ interface HandshakeOptions {
|
|
|
25
25
|
retryInterval?: number;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
interface LogEvent {
|
|
29
|
+
action: string;
|
|
30
|
+
category: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
value?: number;
|
|
33
|
+
customParams?: Record<string, any>;
|
|
34
|
+
}
|
|
35
|
+
interface EventMiddleware {
|
|
36
|
+
handle(event: LogEvent): void;
|
|
37
|
+
}
|
|
38
|
+
declare class EventLogger {
|
|
39
|
+
private middlewares;
|
|
40
|
+
addMiddleware(middleware: EventMiddleware): void;
|
|
41
|
+
removeMiddleware(middleware: EventMiddleware): void;
|
|
42
|
+
log(event: LogEvent): void;
|
|
43
|
+
logChatAction(action: "opened" | "closed" | "initialized", customParams?: Record<string, any>): void;
|
|
44
|
+
logButtonClick(buttonType: "toggle" | "alarm", state?: string, customParams?: Record<string, any>): void;
|
|
45
|
+
logSDKInitialization(success: boolean, startTime: number, error?: string): void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type TapSDKConfig = {
|
|
49
|
+
apiKey: string;
|
|
50
|
+
};
|
|
51
|
+
type TapSDKInitParams = {
|
|
52
|
+
buttonId: string;
|
|
53
|
+
course: Course;
|
|
54
|
+
container?: ContainerStyle;
|
|
55
|
+
};
|
|
56
|
+
type Course = {
|
|
57
|
+
userId: string;
|
|
58
|
+
courseId: string;
|
|
59
|
+
clipId: string;
|
|
60
|
+
clipPlayHead?: number;
|
|
61
|
+
};
|
|
62
|
+
type ContainerStyle = {
|
|
63
|
+
position?: PositionType;
|
|
64
|
+
width?: string;
|
|
65
|
+
height?: string;
|
|
66
|
+
borderRadius?: string;
|
|
67
|
+
};
|
|
68
|
+
type PositionType = {
|
|
69
|
+
top?: string;
|
|
70
|
+
left?: string;
|
|
71
|
+
right?: string;
|
|
72
|
+
bottom?: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
type SeekTimelineParamsType = {
|
|
76
|
+
clipId: string;
|
|
77
|
+
clipPlayHead: number;
|
|
78
|
+
};
|
|
79
|
+
|
|
28
80
|
type ToTapMessage = ChatInitMessage | ChatOpenMessage | ChatCloseMessage | TimelineSeekMessage | AlarmClickMessage | PopUpCloseMessage | PdfEnlargedMessage | PdfShrinkedMessage;
|
|
29
81
|
type FromTapMessage = ChatInitiatedMessage | ChatOpenedMessage | ChatClosedMessage | AlarmFadeInMessage | PopUpOpenMessage | PdfOpenMessage | PdfCloseMessage | TimelineSeekMessage;
|
|
30
82
|
interface ChatInitConfig {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
apiUrl?: string | undefined;
|
|
83
|
+
course: Course;
|
|
84
|
+
container?: ContainerStyle;
|
|
34
85
|
}
|
|
35
86
|
declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
|
|
36
87
|
#private;
|
|
37
88
|
protected hostOrigin: string;
|
|
38
89
|
protected apiKey: string;
|
|
39
90
|
protected iframe: HTMLIFrameElement | null;
|
|
40
|
-
|
|
91
|
+
private eventLogger;
|
|
92
|
+
constructor({ hostOrigin, apiKey, eventLogger, }: {
|
|
41
93
|
hostOrigin: string;
|
|
42
94
|
apiKey: string;
|
|
95
|
+
eventLogger?: EventLogger;
|
|
43
96
|
});
|
|
44
97
|
protected isValidOrigin(_event: MessageEvent): boolean;
|
|
45
98
|
protected getMessageTarget(): Window | null;
|
|
@@ -70,35 +123,6 @@ declare class TapIframeBridge extends Messenger<ToTapMessage, FromTapMessage> {
|
|
|
70
123
|
static defaultHandshakeOptions: HandshakeOptions;
|
|
71
124
|
}
|
|
72
125
|
|
|
73
|
-
type TapSDKConfig = {
|
|
74
|
-
apiKey: string;
|
|
75
|
-
};
|
|
76
|
-
type Course = {
|
|
77
|
-
userId: string;
|
|
78
|
-
courseId: string | null;
|
|
79
|
-
clipId: string | null;
|
|
80
|
-
};
|
|
81
|
-
type CustomStyles = {
|
|
82
|
-
chatBody?: ChatBodyStyle;
|
|
83
|
-
};
|
|
84
|
-
type ChatBodyStyle = {
|
|
85
|
-
position?: PositionType;
|
|
86
|
-
width?: string;
|
|
87
|
-
height?: string;
|
|
88
|
-
borderRadius?: string;
|
|
89
|
-
};
|
|
90
|
-
type PositionType = {
|
|
91
|
-
top?: string;
|
|
92
|
-
left?: string;
|
|
93
|
-
right?: string;
|
|
94
|
-
bottom?: string;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
type SeekTimelineParamsType = {
|
|
98
|
-
clipId: string;
|
|
99
|
-
clipPlayHead: number;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
126
|
declare class EventManager {
|
|
103
127
|
private iframeBridge;
|
|
104
128
|
constructor(iframeBridge: TapIframeBridge);
|
|
@@ -127,16 +151,14 @@ declare class EventManager {
|
|
|
127
151
|
* ```
|
|
128
152
|
*/
|
|
129
153
|
declare class TapSDK {
|
|
130
|
-
#private;
|
|
131
154
|
private apiKey;
|
|
132
155
|
private iframeBridge;
|
|
133
156
|
events: EventManager;
|
|
134
157
|
private eventLogger;
|
|
135
|
-
private
|
|
136
|
-
private chatBodyMaker;
|
|
158
|
+
private container;
|
|
137
159
|
private button;
|
|
138
160
|
private alarm;
|
|
139
|
-
private
|
|
161
|
+
private containerVisible;
|
|
140
162
|
private isPdfOpen;
|
|
141
163
|
private _isInitialized;
|
|
142
164
|
/**
|
|
@@ -147,37 +169,44 @@ declare class TapSDK {
|
|
|
147
169
|
get isOpen(): boolean;
|
|
148
170
|
get isInitialized(): boolean;
|
|
149
171
|
/**
|
|
150
|
-
* Initializes the TapSDK with course data and optional
|
|
172
|
+
* Initializes the TapSDK with course data and optional container styles
|
|
151
173
|
* @param params - Initialization parameters
|
|
152
174
|
* @param params.course - Course information for chat context
|
|
153
|
-
* @param params.
|
|
175
|
+
* @param params.container - Optional container styling options
|
|
154
176
|
* @throws {Error} When initialization fails
|
|
155
177
|
*/
|
|
156
|
-
init({ buttonId, course,
|
|
157
|
-
buttonId: string;
|
|
158
|
-
course: Course;
|
|
159
|
-
customStyles?: CustomStyles;
|
|
160
|
-
}): Promise<void>;
|
|
178
|
+
init({ buttonId, course, container }: TapSDKInitParams): Promise<void>;
|
|
161
179
|
/**
|
|
162
180
|
* Destroys the SDK instance and cleans up all resources
|
|
163
181
|
*/
|
|
164
182
|
destroy(): void;
|
|
165
|
-
private
|
|
166
|
-
private setChatBodyVisible;
|
|
167
|
-
private setIsPdfOpen;
|
|
183
|
+
private setupEventLogger;
|
|
168
184
|
private toggleChatOpen;
|
|
169
185
|
private validateEnvironment;
|
|
170
|
-
private
|
|
186
|
+
private setupContainer;
|
|
187
|
+
private updateContainerStyles;
|
|
171
188
|
private setupButton;
|
|
172
189
|
private setupEventListeners;
|
|
190
|
+
/**
|
|
191
|
+
* Update container styles dynamically
|
|
192
|
+
*/
|
|
193
|
+
updateStyles(container: ContainerStyle): void;
|
|
194
|
+
/**
|
|
195
|
+
* POC: Dynamically set container size
|
|
196
|
+
*/
|
|
197
|
+
setContainerSize(width: string, height: string): void;
|
|
198
|
+
/**
|
|
199
|
+
* POC: Animate container resize
|
|
200
|
+
*/
|
|
201
|
+
animateContainerResize(width: string, height: string, duration?: number): void;
|
|
202
|
+
/**
|
|
203
|
+
* POC: Set responsive mode
|
|
204
|
+
*/
|
|
205
|
+
setResponsiveMode(mode: "compact" | "normal" | "expanded"): void;
|
|
173
206
|
/**
|
|
174
207
|
* @deprecated Use `init` method instead. Will be removed in v1.0.0
|
|
175
208
|
*/
|
|
176
|
-
initChat(params:
|
|
177
|
-
course: Course;
|
|
178
|
-
customStyles?: CustomStyles;
|
|
179
|
-
buttonId: string;
|
|
180
|
-
}): Promise<void>;
|
|
209
|
+
initChat(params: TapSDKInitParams): Promise<void>;
|
|
181
210
|
/**
|
|
182
211
|
* @deprecated Use `events.seekTimeline` method instead. Will be removed in v1.0.0
|
|
183
212
|
*/
|