@returningai/widget-sdk 1.8.6 → 1.8.8
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/CHANGELOG.md +36 -0
- package/README.md +22 -0
- package/dist/rai-banner.iife.js +1 -1
- package/dist/rai-banner.js +1 -1
- package/dist/rai-widget.iife.js +1 -1
- package/dist/rai-widget.js +2 -2
- package/dist/types/jsx.d.ts +37 -28
- package/package.json +7 -3
package/dist/rai-widget.js
CHANGED
|
@@ -15570,7 +15570,7 @@ class CustomWidget extends BaseWidget {
|
|
|
15570
15570
|
}
|
|
15571
15571
|
}
|
|
15572
15572
|
}
|
|
15573
|
-
console.log(`[rai-widget] v${"1.8.
|
|
15573
|
+
console.log(`[rai-widget] v${"1.8.8"}`);
|
|
15574
15574
|
class StoreWidgetCompat extends StoreWidget {
|
|
15575
15575
|
}
|
|
15576
15576
|
const WIDGET_REGISTRY = [
|
|
@@ -15634,7 +15634,7 @@ function exposePublicApi() {
|
|
|
15634
15634
|
})();
|
|
15635
15635
|
const widget = container == null ? void 0 : container.querySelector(ALL_WIDGET_SELECTOR);
|
|
15636
15636
|
window.ReturningAIWidget = {
|
|
15637
|
-
version: "1.8.
|
|
15637
|
+
version: "1.8.8",
|
|
15638
15638
|
reload: () => (widget == null ? void 0 : widget.reload()) ?? Promise.resolve(),
|
|
15639
15639
|
logout: () => (widget == null ? void 0 : widget.logoutPublic()) ?? Promise.resolve(),
|
|
15640
15640
|
isAuthenticated: () => (widget == null ? void 0 : widget.isAuthenticated()) ?? false,
|
package/dist/types/jsx.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
interface RaiWidgetAttributes {
|
|
3
|
-
'community-id': string
|
|
4
|
-
'channel-id'?: string
|
|
5
|
-
'widget-id'?: string // deprecated — use 'community-id'
|
|
1
|
+
interface RaiSharedWidgetAttributes {
|
|
6
2
|
'data-email'?: string
|
|
7
3
|
'widget-type'?: 'store' | 'channel' | 'milestone' | 'social' | 'currency-view' | 'referral-conditions' | 'custom'
|
|
8
4
|
theme?: 'light' | 'dark'
|
|
@@ -24,45 +20,58 @@ interface RaiWidgetAttributes {
|
|
|
24
20
|
style?: string
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
interface RaiCommunityWidgetAttributes extends RaiSharedWidgetAttributes {
|
|
24
|
+
'community-id': string
|
|
25
|
+
'channel-id'?: string
|
|
26
|
+
/** @deprecated Standard widgets should use community-id. */
|
|
27
|
+
'widget-id'?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface RaiCustomWidgetAttributes extends RaiSharedWidgetAttributes {
|
|
31
|
+
'widget-id': string
|
|
32
|
+
'community-id'?: never
|
|
33
|
+
'channel-id'?: never
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type RaiWidgetElementAttributes<TAttributes> = TAttributes & {
|
|
28
37
|
[attributeName: string]: unknown
|
|
29
38
|
}
|
|
30
39
|
|
|
40
|
+
type RaiCommunityWidgetElementAttributes =
|
|
41
|
+
RaiWidgetElementAttributes<RaiCommunityWidgetAttributes>
|
|
42
|
+
|
|
43
|
+
type RaiCustomWidgetElementAttributes =
|
|
44
|
+
RaiWidgetElementAttributes<RaiCustomWidgetAttributes>
|
|
45
|
+
|
|
31
46
|
interface RaiWidgetIntrinsicElements {
|
|
32
|
-
'rai-store-widget':
|
|
33
|
-
'rai-channel-widget':
|
|
34
|
-
'rai-milestone-widget':
|
|
35
|
-
'rai-social-widget':
|
|
36
|
-
'rai-currency-widget':
|
|
37
|
-
'rai-referral-widget':
|
|
38
|
-
'rai-custom-widget':
|
|
39
|
-
'rai-widget':
|
|
47
|
+
'rai-store-widget': RaiCommunityWidgetElementAttributes
|
|
48
|
+
'rai-channel-widget': RaiCommunityWidgetElementAttributes
|
|
49
|
+
'rai-milestone-widget': RaiCommunityWidgetElementAttributes
|
|
50
|
+
'rai-social-widget': RaiCommunityWidgetElementAttributes
|
|
51
|
+
'rai-currency-widget': RaiCommunityWidgetElementAttributes
|
|
52
|
+
'rai-referral-widget': RaiCommunityWidgetElementAttributes
|
|
53
|
+
'rai-custom-widget': RaiCustomWidgetElementAttributes
|
|
54
|
+
'rai-widget': RaiCommunityWidgetElementAttributes
|
|
40
55
|
}
|
|
41
56
|
|
|
42
|
-
// ── React ──────────────────────────────────────────────────────────────────
|
|
43
57
|
declare global {
|
|
44
58
|
namespace React {
|
|
45
59
|
namespace JSX {
|
|
46
60
|
interface IntrinsicElements extends RaiWidgetIntrinsicElements {}
|
|
47
61
|
}
|
|
48
62
|
}
|
|
49
|
-
|
|
50
|
-
namespace JSX {
|
|
51
|
-
interface IntrinsicElements extends RaiWidgetIntrinsicElements {}
|
|
52
|
-
}
|
|
53
63
|
}
|
|
54
64
|
|
|
55
|
-
// ── Vue 3 (Volar / vue-tsc) ────────────────────────────────────────────────
|
|
56
65
|
declare module '@vue/runtime-core' {
|
|
57
66
|
interface GlobalComponents {
|
|
58
|
-
RaiStoreWidget:
|
|
59
|
-
RaiChannelWidget:
|
|
60
|
-
RaiMilestoneWidget: { $props:
|
|
61
|
-
RaiSocialWidget:
|
|
62
|
-
RaiCurrencyWidget:
|
|
63
|
-
RaiReferralWidget: { $props:
|
|
64
|
-
RaiCustomWidget:
|
|
65
|
-
RaiWidget:
|
|
67
|
+
RaiStoreWidget: { $props: RaiCommunityWidgetElementAttributes }
|
|
68
|
+
RaiChannelWidget: { $props: RaiCommunityWidgetElementAttributes }
|
|
69
|
+
RaiMilestoneWidget: { $props: RaiCommunityWidgetElementAttributes }
|
|
70
|
+
RaiSocialWidget: { $props: RaiCommunityWidgetElementAttributes }
|
|
71
|
+
RaiCurrencyWidget: { $props: RaiCommunityWidgetElementAttributes }
|
|
72
|
+
RaiReferralWidget: { $props: RaiCommunityWidgetElementAttributes }
|
|
73
|
+
RaiCustomWidget: { $props: RaiCustomWidgetElementAttributes }
|
|
74
|
+
RaiWidget: { $props: RaiCommunityWidgetElementAttributes }
|
|
66
75
|
}
|
|
67
76
|
}
|
|
68
77
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@returningai/widget-sdk",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.8",
|
|
4
4
|
"description": "Shadow DOM isolated widget SDK for ReturningAI",
|
|
5
5
|
"main": "dist/rai-widget.iife.js",
|
|
6
6
|
"module": "dist/rai-widget.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"sideEffects": true,
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
11
12
|
"import": "./dist/rai-widget.js",
|
|
12
13
|
"default": "./dist/rai-widget.iife.js"
|
|
13
14
|
}
|
|
@@ -37,17 +38,20 @@
|
|
|
37
38
|
"test:auth-session-coordinator": "rm -rf test/.tmp && tsc -p test/tsconfig.json && node test/.tmp/test/auth-session-coordinator.test.js",
|
|
38
39
|
"test:startup-performance": "rm -rf test/.tmp && tsc -p test/tsconfig.json && node test/.tmp/test/startup-performance.test.js",
|
|
39
40
|
"test:widget-error-presentation": "rm -rf test/.tmp && tsc -p test/tsconfig.json && node test/.tmp/test/widget-error-presentation.test.js",
|
|
40
|
-
"test:jsx-types": "
|
|
41
|
+
"test:jsx-types": "npm run types && node --test test/jsx/declaration-shape.test.mjs test/jsx/packed-consumer.test.mjs && tsc -p test/jsx/tsconfig.react.json && tsc -p test/jsx/tsconfig.vue.json",
|
|
41
42
|
"coverage:repowise": "rm -rf coverage && npm run coverage:host-callback && npm run coverage:bundle-readiness && npm run test:jsx-types",
|
|
42
43
|
"coverage:host-callback": "rm -rf test/.tmp && tsc -p test/tsconfig.json && c8 --reporter=lcov --reports-dir=coverage/host-callback --exclude-after-remap --exclude='**/*.test.ts' node test/.tmp/test/postmessage-host-callback.test.js && node scripts/name-lcov-test.mjs coverage/host-callback/lcov.info test/postmessage-host-callback.test.ts",
|
|
43
44
|
"coverage:bundle-readiness": "rm -rf test/.tmp && tsc -p test/tsconfig.json && c8 --reporter=lcov --reports-dir=coverage/bundle-readiness --exclude-after-remap --exclude='**/*.test.ts' node test/.tmp/test/bundle-readiness.test.js && node scripts/name-lcov-test.mjs coverage/bundle-readiness/lcov.info test/bundle-readiness.test.ts",
|
|
44
45
|
"prepublishOnly": "npm run build:all:min && npm run types"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
48
|
+
"@types/react": "^19.1.10",
|
|
47
49
|
"c8": "^11.0.0",
|
|
50
|
+
"react": "^19.2.8",
|
|
48
51
|
"terser": "^5.46.0",
|
|
49
52
|
"typescript": "^5.3.3",
|
|
50
|
-
"vite": "^5.1.0"
|
|
53
|
+
"vite": "^5.1.0",
|
|
54
|
+
"vue": "^3.5.21"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
57
|
"dompurify": "^3.4.12",
|