@colixsystems/widget-sdk 0.149.1 → 0.150.1
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 +48 -5
- package/dist/contract.cjs +27 -6
- package/dist/contract.js +27 -6
- package/dist/emoji-data.js +1758 -0
- package/dist/emoji-picker-tokens.js +68 -0
- package/dist/emoji-picker-view.js +193 -0
- package/dist/emoji-picker.js +14 -0
- package/dist/emoji-picker.native.js +16 -0
- package/dist/emoji-reactions.js +167 -0
- package/dist/index.js +24 -0
- package/dist/index.native.js +23 -0
- package/dist/linter.cjs +21 -9
- package/dist/linter.js +21 -9
- package/dist/theme-components.cjs +9 -4
- package/dist/theme-components.js +9 -4
- package/package.json +1 -1
package/dist/theme-components.js
CHANGED
|
@@ -91,6 +91,11 @@ export function normaliseThemeComponents(raw) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
// Long enough for a hex, an enum value or a font name; short enough that a
|
|
95
|
+
// hand-edited theme_config cannot smuggle a payload into every widget.
|
|
96
|
+
// Named because the Mason plan gate prints it when it rejects a value.
|
|
97
|
+
export const MAX_STYLE_STRING_LENGTH = 64;
|
|
98
|
+
|
|
94
99
|
// Values are assigned onto plain object literals, so `__proto__` would set a
|
|
95
100
|
// PROTOTYPE rather than a style field. Refused at every level.
|
|
96
101
|
const UNSAFE_STYLE_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
@@ -117,9 +122,9 @@ function coerceWidgetStyleValue(value, depth = 0) {
|
|
|
117
122
|
const { maxValueDepth, maxValueEntries } = CONTRACT.themeWidgetStyles;
|
|
118
123
|
if (typeof value === "string") {
|
|
119
124
|
const trimmed = value.trim();
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
return trimmed && trimmed.length <= MAX_STYLE_STRING_LENGTH
|
|
126
|
+
? trimmed
|
|
127
|
+
: undefined;
|
|
123
128
|
}
|
|
124
129
|
if (typeof value === "number") return Number.isFinite(value) ? value : undefined;
|
|
125
130
|
if (typeof value === "boolean") return value;
|
|
@@ -157,7 +162,7 @@ function coerceWidgetStyleValue(value, depth = 0) {
|
|
|
157
162
|
}
|
|
158
163
|
|
|
159
164
|
// What the value actually costs the cold-start read and the baked export.
|
|
160
|
-
function styleValueBytes(value) {
|
|
165
|
+
export function styleValueBytes(value) {
|
|
161
166
|
const json = JSON.stringify(value);
|
|
162
167
|
return typeof json === "string" ? json.length : Infinity;
|
|
163
168
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.150.1",
|
|
4
4
|
"description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
|
|
5
5
|
"homepage": "https://github.com/Colix-AB/AppStudio",
|
|
6
6
|
"type": "module",
|