@lumiastream/ui 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export { LSTextField, LSTextFieldProps } from './LSTextField.js';
12
12
  export { IVariables, LSVariableInputContextValue, LSVariableInputField, LSVariableInputFieldProps, LSVariableInputProvider } from './LSVariableInputField.js';
13
13
  export { codeMirrorlinterOptions, variableCompletionOptions } from './utils.js';
14
14
  export { BuildChatMessageContentOptions, ChatMessageContentItem, ChatMessageEmoteStore, ChatMessageToken, ChatMessageTokenizationOptions, ChatboxMediaPreview, ChatboxMediaPreviewKind, ChatterProfileResolver, ChatterProfileResolverPayload, ChatterProfileUrlInput, MEDIA_PREVIEW_USER_LEVEL_VALUES, MediaPreviewRoleSettings, MediaPreviewRoleSettingsInput, MediaPreviewUserLevel, MessageLinkPart, ResolveChatterProfileUrlWithResolversInput, buildChatMessageContent, getMediaPreviewFromUrl, getNormalizedUserLevels, isMediaPreviewAllowedForUser, normalizeHttpUrl, normalizeMediaPreviewUserLevels, parseMessageLinks, resolveChatterProfileUrlWithResolvers, resolveMediaPreviewRoleSettings, resolveMediaPreviewSetting, resolvePlatformChatterProfileUrl, tokenizeChatMessage } from './utils/chatMedia.js';
15
- export { AIGeneratedCustomOverlay, AssetMirrorProgress, FLAG_OFF_REASONS, ImportCoverage, ImportResult, JWT_DASHBOARD_URL, JwtInstructionStep, MarketplacePicker, MarketplacePickerProps, ModuleType, OverlayLayerBounds, OverlayLayerState, OverlayLayerType, OverlayModuleAlertState, OverlayModuleState, OverlaySettings, OverlayState, ReviewItem, SEAccountClaims, SEAuthDiagnostic, SEAuthError, SEAuthErrorCode, SEAuthMode, SEAuthProbeResult, SEBootstrapResponse, SEChannelSummary, SEClient, SECustomEmbedProps, SEExistingAsset, SEImportBindings, SEImportWizard, SEImportWizardProps, SEOverlaySummary, SESaveOverlayBody, SEUploadAssetResult, SEUsersCurrentResponse, SEWidget, SE_WIDGET_TO_MARKETPLACE_CANDIDATES, TransplantedUnit, applyReviewAction, buildAIPromptForSEWidget, buildBootstrapUrl, decodeJwtPayload, diagnoseSEAuth, extractSEOverlayId, extractSEPreviewParts, fetchSEBootstrap, fetchSEFiltersRaw, fetchSEOverlays, fetchUsableChannels, filenameFromURL, findSEAssetURLs, getAILandingBounds, getJwtInstructionSteps, getMarketplaceCandidates, hasMarketplaceCandidates, importSEBootstrap, isSEBootstrap, isWidgetFlaggedOff, listTransplantableLayers, mirrorOneAsset, rewriteAssetURLs, streamElementsCopyJwt, transplantLayer } from './se-import.js';
15
+ export { AIGeneratedCustomOverlay, AssetMirrorProgress, FLAG_OFF_REASONS, ImportCoverage, ImportResult, JWT_DASHBOARD_URL, JwtInstructionStep, MarketplacePicker, MarketplacePickerProps, ModuleType, OverlayLayerBounds, OverlayLayerState, OverlayLayerType, OverlayModuleAlertState, OverlayModuleState, OverlaySettings, OverlayState, ReviewItem, SEAccountClaims, SEAuthDiagnostic, SEAuthError, SEAuthErrorCode, SEAuthMode, SEAuthProbeResult, SEBootstrapResponse, SEChannelSummary, SEClient, SECustomEmbedProps, SEExistingAsset, SEImportBindings, SEImportWizard, SEImportWizardProps, SEOverlaySummary, SESaveOverlayBody, SEUploadAssetResult, SEUsersCurrentResponse, SEWidget, SE_WIDGET_TO_MARKETPLACE_CANDIDATES, TransplantedUnit, applyReviewAction, buildAIPromptForSEWidget, buildBootstrapUrl, decodeJwtPayload, diagnoseSEAuth, extractSEOverlayId, extractSEPreviewParts, fetchSEBootstrap, fetchSEFiltersRaw, fetchSEOverlays, fetchUsableChannels, filenameFromURL, findSEAssetURLs, getAILandingBounds, getJwtInstructionSteps, getMarketplaceCandidates, hasMarketplaceCandidates, importSEBootstrap, isSEBootstrap, isWidgetFlaggedOff, listTransplantableLayers, mirrorOneAsset, rewriteAssetURLs, streamElementsCopyJwt, substituteSeTokens, transplantLayer } from './se-import.js';
16
16
  import 'react/jsx-runtime';
17
17
  import '@mui/material/Button';
18
18
  import 'react';
package/dist/index.js CHANGED
@@ -6790,6 +6790,29 @@ function hasMarketplaceCandidates(seWidgetType) {
6790
6790
  return getMarketplaceCandidates(seWidgetType).length > 0;
6791
6791
  }
6792
6792
 
6793
+ // src/se-import/substitute.ts
6794
+ function substituteSeTokens(text, data) {
6795
+ if (typeof text !== "string" || text.length === 0) return "";
6796
+ const keys = Object.keys(data).filter(
6797
+ (k) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k)
6798
+ );
6799
+ if (keys.length === 0) return text;
6800
+ const escaped = keys.map((k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
6801
+ const pattern = new RegExp(
6802
+ "(?<![{\\\\])\\{(" + escaped.join("|") + ")\\}",
6803
+ "g"
6804
+ );
6805
+ return text.replace(pattern, (_m, key) => {
6806
+ const v = data[key];
6807
+ if (v == null) return "";
6808
+ if (typeof v === "object") {
6809
+ const obj = v;
6810
+ return String(obj.value ?? JSON.stringify(v));
6811
+ }
6812
+ return String(v);
6813
+ });
6814
+ }
6815
+
6793
6816
  // src/se-import/api/seClient.ts
6794
6817
  var SEAuthError = class extends Error {
6795
6818
  constructor(code, message) {
@@ -10006,6 +10029,7 @@ export {
10006
10029
  resolvePlatformChatterProfileUrl,
10007
10030
  rewriteAssetURLs,
10008
10031
  streamElementsCopyJwt,
10032
+ substituteSeTokens,
10009
10033
  tokenizeChatMessage,
10010
10034
  transplantLayer,
10011
10035
  variableCompletionOptions
@@ -218,6 +218,8 @@ declare function hasMarketplaceCandidates(seWidgetType: string): boolean;
218
218
  declare function isWidgetFlaggedOff(_seType: string): boolean;
219
219
  declare const FLAG_OFF_REASONS: Record<string, string>;
220
220
 
221
+ declare function substituteSeTokens(text: string | null | undefined, data: Record<string, unknown>): string;
222
+
221
223
  interface SEAccountClaims {
222
224
  channel: string;
223
225
  user: string;
@@ -441,4 +443,4 @@ declare function buildAIPromptForSEWidget(widget: SEWidget, canvas?: {
441
443
  height: number;
442
444
  }): string;
443
445
 
444
- export { type AIGeneratedCustomOverlay, type AssetMirrorProgress, FLAG_OFF_REASONS, type ImportCoverage, type ImportResult, JWT_DASHBOARD_URL, type JwtInstructionStep, MarketplacePicker, type MarketplacePickerProps, type ModuleType, type OverlayLayerBounds, type OverlayLayerState, type OverlayLayerType, type OverlayModuleAlertState, type OverlayModuleState, type OverlaySettings, type OverlayState, type ReviewItem, type SEAccountClaims, type SEAuthDiagnostic, SEAuthError, type SEAuthErrorCode, type SEAuthMode, type SEAuthProbeResult, type SEBootstrapResponse, type SEChannelSummary, SEClient, type SECustomEmbedProps, type SEExistingAsset, type SEImportBindings, SEImportWizard, type SEImportWizardProps, type SEOverlaySummary, type SESaveOverlayBody, type SEUploadAssetResult, type SEUsersCurrentResponse, type SEWidget, SE_WIDGET_TO_MARKETPLACE_CANDIDATES, type TransplantedUnit, applyReviewAction, buildAIPromptForSEWidget, buildBootstrapUrl, decodeJwtPayload, diagnoseSEAuth, extractSEOverlayId, extractSEPreviewParts, fetchSEBootstrap, fetchSEFiltersRaw, fetchSEOverlays, fetchUsableChannels, filenameFromURL, findSEAssetURLs, getAILandingBounds, getJwtInstructionSteps, getMarketplaceCandidates, hasMarketplaceCandidates, importSEBootstrap, isSEBootstrap, isWidgetFlaggedOff, listTransplantableLayers, mirrorOneAsset, rewriteAssetURLs, streamElementsCopyJwt, transplantLayer };
446
+ export { type AIGeneratedCustomOverlay, type AssetMirrorProgress, FLAG_OFF_REASONS, type ImportCoverage, type ImportResult, JWT_DASHBOARD_URL, type JwtInstructionStep, MarketplacePicker, type MarketplacePickerProps, type ModuleType, type OverlayLayerBounds, type OverlayLayerState, type OverlayLayerType, type OverlayModuleAlertState, type OverlayModuleState, type OverlaySettings, type OverlayState, type ReviewItem, type SEAccountClaims, type SEAuthDiagnostic, SEAuthError, type SEAuthErrorCode, type SEAuthMode, type SEAuthProbeResult, type SEBootstrapResponse, type SEChannelSummary, SEClient, type SECustomEmbedProps, type SEExistingAsset, type SEImportBindings, SEImportWizard, type SEImportWizardProps, type SEOverlaySummary, type SESaveOverlayBody, type SEUploadAssetResult, type SEUsersCurrentResponse, type SEWidget, SE_WIDGET_TO_MARKETPLACE_CANDIDATES, type TransplantedUnit, applyReviewAction, buildAIPromptForSEWidget, buildBootstrapUrl, decodeJwtPayload, diagnoseSEAuth, extractSEOverlayId, extractSEPreviewParts, fetchSEBootstrap, fetchSEFiltersRaw, fetchSEOverlays, fetchUsableChannels, filenameFromURL, findSEAssetURLs, getAILandingBounds, getJwtInstructionSteps, getMarketplaceCandidates, hasMarketplaceCandidates, importSEBootstrap, isSEBootstrap, isWidgetFlaggedOff, listTransplantableLayers, mirrorOneAsset, rewriteAssetURLs, streamElementsCopyJwt, substituteSeTokens, transplantLayer };
package/dist/se-import.js CHANGED
@@ -3656,6 +3656,29 @@ function hasMarketplaceCandidates(seWidgetType) {
3656
3656
  return getMarketplaceCandidates(seWidgetType).length > 0;
3657
3657
  }
3658
3658
 
3659
+ // src/se-import/substitute.ts
3660
+ function substituteSeTokens(text, data) {
3661
+ if (typeof text !== "string" || text.length === 0) return "";
3662
+ const keys = Object.keys(data).filter(
3663
+ (k) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k)
3664
+ );
3665
+ if (keys.length === 0) return text;
3666
+ const escaped = keys.map((k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
3667
+ const pattern = new RegExp(
3668
+ "(?<![{\\\\])\\{(" + escaped.join("|") + ")\\}",
3669
+ "g"
3670
+ );
3671
+ return text.replace(pattern, (_m, key) => {
3672
+ const v = data[key];
3673
+ if (v == null) return "";
3674
+ if (typeof v === "object") {
3675
+ const obj = v;
3676
+ return String(obj.value ?? JSON.stringify(v));
3677
+ }
3678
+ return String(v);
3679
+ });
3680
+ }
3681
+
3659
3682
  // src/se-import/api/seClient.ts
3660
3683
  var SEAuthError = class extends Error {
3661
3684
  constructor(code, message) {
@@ -8848,5 +8871,6 @@ export {
8848
8871
  mirrorOneAsset,
8849
8872
  rewriteAssetURLs,
8850
8873
  streamElementsCopyJwt,
8874
+ substituteSeTokens,
8851
8875
  transplantLayer
8852
8876
  };
package/package.json CHANGED
@@ -1,138 +1,138 @@
1
1
  {
2
- "name": "@lumiastream/ui",
3
- "version": "0.3.8",
4
- "author": "Lumia Stream",
5
- "license": "ISC",
6
- "description": "Lumia UI Kit",
7
- "packageManager": "npm@11.9.0",
8
- "type": "module",
9
- "main": "dist/index.js",
10
- "module": "dist/index.js",
11
- "types": "dist/index.d.ts",
12
- "files": [
13
- "dist"
14
- ],
15
- "exports": {
16
- ".": {
17
- "types": "./dist/index.d.ts",
18
- "import": "./dist/index.js"
19
- },
20
- "./components": {
21
- "types": "./dist/components.d.ts",
22
- "import": "./dist/components.js"
23
- },
24
- "./LSButton": {
25
- "types": "./dist/LSButton.d.ts",
26
- "import": "./dist/LSButton.js"
27
- },
28
- "./LSCheckbox": {
29
- "types": "./dist/LSCheckbox.d.ts",
30
- "import": "./dist/LSCheckbox.js"
31
- },
32
- "./LSColorPicker": {
33
- "types": "./dist/LSColorPicker.d.ts",
34
- "import": "./dist/LSColorPicker.js"
35
- },
36
- "./LSDatePicker": {
37
- "types": "./dist/LSDatePicker.d.ts",
38
- "import": "./dist/LSDatePicker.js"
39
- },
40
- "./LSFontPicker": {
41
- "types": "./dist/LSFontPicker.d.ts",
42
- "import": "./dist/LSFontPicker.js"
43
- },
44
- "./LSInput": {
45
- "types": "./dist/LSInput.d.ts",
46
- "import": "./dist/LSInput.js"
47
- },
48
- "./LSMultiSelect": {
49
- "types": "./dist/LSMultiSelect.d.ts",
50
- "import": "./dist/LSMultiSelect.js"
51
- },
52
- "./LSRadio": {
53
- "types": "./dist/LSRadio.d.ts",
54
- "import": "./dist/LSRadio.js"
55
- },
56
- "./LSSelect": {
57
- "types": "./dist/LSSelect.d.ts",
58
- "import": "./dist/LSSelect.js"
59
- },
60
- "./LSSliderInput": {
61
- "types": "./dist/LSSliderInput.d.ts",
62
- "import": "./dist/LSSliderInput.js"
63
- },
64
- "./LSTextField": {
65
- "types": "./dist/LSTextField.d.ts",
66
- "import": "./dist/LSTextField.js"
67
- },
68
- "./LSVariableInputField": {
69
- "types": "./dist/LSVariableInputField.d.ts",
70
- "import": "./dist/LSVariableInputField.js"
71
- },
72
- "./utils": {
73
- "types": "./dist/utils.d.ts",
74
- "import": "./dist/utils.js"
75
- },
76
- "./utils/chatMedia": {
77
- "types": "./dist/utils/chatMedia.d.ts",
78
- "import": "./dist/utils/chatMedia.js"
79
- },
80
- "./se-import": {
81
- "types": "./dist/se-import.d.ts",
82
- "import": "./dist/se-import.js"
83
- }
84
- },
85
- "scripts": {
86
- "start": "storybook dev -p 6006",
87
- "build": "tsup",
88
- "build-storybook": "storybook build",
89
- "watch": "tsup --watch",
90
- "test": "vitest run",
91
- "test:watch": "vitest",
92
- "release": "changeset && changeset tag && npm run build && npm publish",
93
- "prepublishOnly": "npm run build",
94
- "postpublish": "npm cache clean --force && node ./scripts/postpublish-install.mjs",
95
- "check-module-defaults": "tsx scripts/check-module-defaults.ts"
96
- },
97
- "peerDependencies": {
98
- "@codemirror/autocomplete": "^6.0.0",
99
- "@emotion/react": "^11.14.0",
100
- "@emotion/styled": "^11.14.1",
101
- "@mui/icons-material": "^9.0.0",
102
- "@mui/material": "^9.0.0",
103
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
104
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
105
- "react-hook-form": "^7.62.0"
106
- },
107
- "devDependencies": {
108
- "@codemirror/autocomplete": "^6.20.1",
109
- "@emotion/react": "^11.14.0",
110
- "@emotion/styled": "^11.14.1",
111
- "@mui/icons-material": "^9.0.0",
112
- "@mui/material": "^9.0.0",
113
- "@storybook/builder-vite": "^10.2.17",
114
- "@storybook/react-vite": "^10.2.17",
115
- "@types/node": "^25.5.0",
116
- "@types/react": "^19.2.14",
117
- "@types/react-dom": "19.2.3",
118
- "postcss": "^8.5.14",
119
- "react": "^19.2.0",
120
- "react-dom": "^19.2.0",
121
- "react-hook-form": "^7.73.1",
122
- "sass-embedded": "^1.99.0",
123
- "storybook": "^10.2.17",
124
- "tsup": "^8.5.1",
125
- "tsx": "^4.22.3",
126
- "typescript": "^5.9.3",
127
- "vite": "^8.0.8",
128
- "vitest": "^4.1.6"
129
- },
130
- "dependencies": {
131
- "@lumiastream/lumia-translations": "1.16.0",
132
- "@lumiastream/lumia-types": "^3.3.7-alpha.2",
133
- "classnames": "^2.5.1",
134
- "globals": "^17.4.0",
135
- "nanoid": "^5.1.11",
136
- "react-best-gradient-color-picker": "^3.0.14"
137
- }
2
+ "name": "@lumiastream/ui",
3
+ "version": "0.3.9",
4
+ "author": "Lumia Stream",
5
+ "license": "ISC",
6
+ "description": "Lumia UI Kit",
7
+ "packageManager": "npm@11.9.0",
8
+ "type": "module",
9
+ "main": "dist/index.js",
10
+ "module": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./components": {
21
+ "types": "./dist/components.d.ts",
22
+ "import": "./dist/components.js"
23
+ },
24
+ "./LSButton": {
25
+ "types": "./dist/LSButton.d.ts",
26
+ "import": "./dist/LSButton.js"
27
+ },
28
+ "./LSCheckbox": {
29
+ "types": "./dist/LSCheckbox.d.ts",
30
+ "import": "./dist/LSCheckbox.js"
31
+ },
32
+ "./LSColorPicker": {
33
+ "types": "./dist/LSColorPicker.d.ts",
34
+ "import": "./dist/LSColorPicker.js"
35
+ },
36
+ "./LSDatePicker": {
37
+ "types": "./dist/LSDatePicker.d.ts",
38
+ "import": "./dist/LSDatePicker.js"
39
+ },
40
+ "./LSFontPicker": {
41
+ "types": "./dist/LSFontPicker.d.ts",
42
+ "import": "./dist/LSFontPicker.js"
43
+ },
44
+ "./LSInput": {
45
+ "types": "./dist/LSInput.d.ts",
46
+ "import": "./dist/LSInput.js"
47
+ },
48
+ "./LSMultiSelect": {
49
+ "types": "./dist/LSMultiSelect.d.ts",
50
+ "import": "./dist/LSMultiSelect.js"
51
+ },
52
+ "./LSRadio": {
53
+ "types": "./dist/LSRadio.d.ts",
54
+ "import": "./dist/LSRadio.js"
55
+ },
56
+ "./LSSelect": {
57
+ "types": "./dist/LSSelect.d.ts",
58
+ "import": "./dist/LSSelect.js"
59
+ },
60
+ "./LSSliderInput": {
61
+ "types": "./dist/LSSliderInput.d.ts",
62
+ "import": "./dist/LSSliderInput.js"
63
+ },
64
+ "./LSTextField": {
65
+ "types": "./dist/LSTextField.d.ts",
66
+ "import": "./dist/LSTextField.js"
67
+ },
68
+ "./LSVariableInputField": {
69
+ "types": "./dist/LSVariableInputField.d.ts",
70
+ "import": "./dist/LSVariableInputField.js"
71
+ },
72
+ "./utils": {
73
+ "types": "./dist/utils.d.ts",
74
+ "import": "./dist/utils.js"
75
+ },
76
+ "./utils/chatMedia": {
77
+ "types": "./dist/utils/chatMedia.d.ts",
78
+ "import": "./dist/utils/chatMedia.js"
79
+ },
80
+ "./se-import": {
81
+ "types": "./dist/se-import.d.ts",
82
+ "import": "./dist/se-import.js"
83
+ }
84
+ },
85
+ "scripts": {
86
+ "start": "storybook dev -p 6006",
87
+ "build": "tsup",
88
+ "build-storybook": "storybook build",
89
+ "watch": "tsup --watch",
90
+ "test": "vitest run",
91
+ "test:watch": "vitest",
92
+ "release": "changeset && changeset tag && npm run build && npm publish",
93
+ "prepublishOnly": "npm run build",
94
+ "postpublish": "npm cache clean --force && node ./scripts/postpublish-install.mjs",
95
+ "check-module-defaults": "tsx scripts/check-module-defaults.ts"
96
+ },
97
+ "peerDependencies": {
98
+ "@codemirror/autocomplete": "^6.0.0",
99
+ "@emotion/react": "^11.14.0",
100
+ "@emotion/styled": "^11.14.1",
101
+ "@mui/icons-material": "^9.0.0",
102
+ "@mui/material": "^9.0.0",
103
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
104
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
105
+ "react-hook-form": "^7.62.0"
106
+ },
107
+ "devDependencies": {
108
+ "@codemirror/autocomplete": "^6.20.1",
109
+ "@emotion/react": "^11.14.0",
110
+ "@emotion/styled": "^11.14.1",
111
+ "@mui/icons-material": "^9.0.0",
112
+ "@mui/material": "^9.0.0",
113
+ "@storybook/builder-vite": "^10.2.17",
114
+ "@storybook/react-vite": "^10.2.17",
115
+ "@types/node": "^25.5.0",
116
+ "@types/react": "^19.2.14",
117
+ "@types/react-dom": "19.2.3",
118
+ "postcss": "^8.5.14",
119
+ "react": "^19.2.0",
120
+ "react-dom": "^19.2.0",
121
+ "react-hook-form": "^7.73.1",
122
+ "sass-embedded": "^1.99.0",
123
+ "storybook": "^10.2.17",
124
+ "tsup": "^8.5.1",
125
+ "tsx": "^4.22.3",
126
+ "typescript": "^5.9.3",
127
+ "vite": "^8.0.8",
128
+ "vitest": "^4.1.6"
129
+ },
130
+ "dependencies": {
131
+ "@lumiastream/lumia-translations": "1.16.0",
132
+ "@lumiastream/lumia-types": "^3.3.7-alpha.2",
133
+ "classnames": "^2.5.1",
134
+ "globals": "^17.4.0",
135
+ "nanoid": "^5.1.11",
136
+ "react-best-gradient-color-picker": "^3.0.14"
137
+ }
138
138
  }