@colixsystems/widget-sdk 0.22.0 → 0.23.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 CHANGED
@@ -45,7 +45,25 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
45
45
 
46
46
  ## Status
47
47
 
48
- `v0.22.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
48
+ `v0.23.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
49
+
50
+ ### What's new in 0.23.0
51
+
52
+ **Curated cross-platform package expansion to the vetted import allowlist (REQ-WSDK-PKG-EXPAND).**
53
+
54
+ - The linter's vetted import allowlist (`CONTRACT.vettedImports`) gains a curated set of popular React Native packages, each of which runs on **both** web and native (directly, or via a documented platform-split counterpart):
55
+ - **`react-native-reanimated`** (`web`/`native`) — declarative animations.
56
+ - **`react-native-gesture-handler`** (`web`/`native`) — native-driven touch gestures.
57
+ - **`react-native-safe-area-context`** (`web`/`native`) — safe-area insets.
58
+ - **`@shopify/flash-list`** (`web`/`native`) — high-performance virtualised list.
59
+ - **`react-native-paper`** (`web`/`native`) — Material Design components.
60
+ - **`react-native-vector-icons`** (`web`/`native`) — icon font families.
61
+ - **`@react-native-community/slider`** (`web`/`native`) — slider input.
62
+ - **`expo-linear-gradient`** (`web`/`native`) — the cross-platform gradient.
63
+ - **`lottie-react-native`** (`native`) + **`lottie-react`** (`web`) — Lottie animations, split-impl.
64
+ - **`react-native-webview`** (`native`) — embedded web content (pair with an `<iframe>` on web).
65
+ - **Parity (CLAUDE.md §3):** the compiler now pins the native-module members in the exported Expo app's `package.json` and emits the **`react-native-reanimated/plugin`** in `babel.config.js` **unconditionally** (previously only for the sidebar-drawer shell), so a baked widget that imports any of these resolves and bundles on native exactly as it renders in the web Player.
66
+ - **`CONTRACT.version` → `1.13.0`** (additive: new vetted import entries only). No existing export, type, manifest field, hook, or banned-API list changed.
49
67
 
50
68
  ### What's new in 0.22.0
51
69
 
package/dist/contract.cjs CHANGED
@@ -913,6 +913,89 @@ const VETTED_IMPORTS = [
913
913
  description:
914
914
  "Native haptic feedback. Pair with navigator.vibrate in widget.web.jsx.",
915
915
  },
916
+ // REQ-WSDK-PKG-EXPAND — curated cross-platform package expansion. Each entry
917
+ // below runs on web AND native (directly, or via the documented platform-split
918
+ // counterpart). Native-module packages additionally carry a pinned version in
919
+ // the compiler's generatePackageJson so a baked marketplace widget resolves in
920
+ // the Expo export (CLAUDE.md §3 parity). See the `adding-vetted-packages` skill
921
+ // for the full add checklist (contract ×2, version bump, compiler pin, docs).
922
+ {
923
+ specifier: "react-native-reanimated",
924
+ platforms: ["web", "native"],
925
+ category: "animation",
926
+ description:
927
+ "Declarative, performant animations. Works on both platforms; the export always emits the required react-native-reanimated/plugin in babel.config.js so a widget using worklets bundles on native.",
928
+ },
929
+ {
930
+ specifier: "react-native-gesture-handler",
931
+ platforms: ["web", "native"],
932
+ category: "gesture",
933
+ description:
934
+ "Native-driven touch gestures (pan, pinch, swipe, long-press). Works on both platforms; wrap interactive trees in GestureHandlerRootView.",
935
+ },
936
+ {
937
+ specifier: "react-native-safe-area-context",
938
+ platforms: ["web", "native"],
939
+ category: "layout",
940
+ description:
941
+ "Safe-area insets (notch / status bar). useSafeAreaInsets() returns zeros on web and the real insets on native, so the same layout code is safe on both.",
942
+ },
943
+ {
944
+ specifier: "@shopify/flash-list",
945
+ platforms: ["web", "native"],
946
+ category: "list",
947
+ description:
948
+ "High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms.",
949
+ },
950
+ {
951
+ specifier: "react-native-paper",
952
+ platforms: ["web", "native"],
953
+ category: "ui",
954
+ description:
955
+ "Material Design component library built on react-native + react-native-web, so the same components render identically on both platforms.",
956
+ },
957
+ {
958
+ specifier: "react-native-vector-icons",
959
+ platforms: ["web", "native"],
960
+ category: "iconography",
961
+ description:
962
+ "Icon font families (MaterialIcons, FontAwesome, Ionicons, …). Works on both platforms; prefer the SDK's <Icon> (lucide) primitive for the common case.",
963
+ },
964
+ {
965
+ specifier: "@react-native-community/slider",
966
+ platforms: ["web", "native"],
967
+ category: "input",
968
+ description:
969
+ "Cross-platform slider input. Controlled — value + onValueChange. Works on both platforms.",
970
+ },
971
+ {
972
+ specifier: "expo-linear-gradient",
973
+ platforms: ["web", "native"],
974
+ category: "drawing",
975
+ description:
976
+ "Linear-gradient fill (<LinearGradient colors={[...]} />). The cross-platform gradient — works on both platforms (react-native-linear-gradient is native-only; prefer this).",
977
+ },
978
+ {
979
+ specifier: "lottie-react-native",
980
+ platforms: ["native"],
981
+ category: "animation",
982
+ description:
983
+ "After Effects (Bodymovin) JSON animations. Native-only; pair with lottie-react in widget.web.jsx for the web variant.",
984
+ },
985
+ {
986
+ specifier: "lottie-react",
987
+ platforms: ["web"],
988
+ category: "animation",
989
+ description:
990
+ "Web Lottie player. Web-only counterpart to lottie-react-native; bundle it into widget.web.jsx.",
991
+ },
992
+ {
993
+ specifier: "react-native-webview",
994
+ platforms: ["native"],
995
+ category: "media",
996
+ description:
997
+ "Embeds web content in a native WebView. Native-only; on web render an <iframe> (or a View with the URL) in widget.web.jsx.",
998
+ },
916
999
  ];
917
1000
 
918
1001
  // Back-compat shape — every existing consumer (widgetLoader, the static
@@ -1042,7 +1125,18 @@ const CONTRACT = deepFreeze({
1042
1125
  // cascading dropdowns; tenant-copy remaps `tableId` and nulls `recordId`
1043
1126
  // (records are business data, never copied). No existing type changed
1044
1127
  // shape, so this is additive — minor bump on the pre-1.0 channel.
1045
- version: "1.12.0",
1128
+ //
1129
+ // 1.13.0: additive (REQ-WSDK-PKG-EXPAND) — the vetted import allowlist gains
1130
+ // a curated cross-platform package set: react-native-reanimated,
1131
+ // react-native-gesture-handler, react-native-safe-area-context,
1132
+ // @shopify/flash-list, react-native-paper, react-native-vector-icons,
1133
+ // @react-native-community/slider, expo-linear-gradient, react-native-webview,
1134
+ // and lottie-react-native (+ lottie-react as its web counterpart). No
1135
+ // existing entry changed shape and no other contract field moved, so this
1136
+ // is additive — minor bump on the pre-1.0 channel. The compiler pins the
1137
+ // native-module members in the exported Expo app's package.json and now
1138
+ // always emits the react-native-reanimated/plugin (CLAUDE.md §3 parity).
1139
+ version: "1.13.0",
1046
1140
  hooks: HOOKS,
1047
1141
  primitives: PRIMITIVES,
1048
1142
  manifestSchema: MANIFEST_SCHEMA,
package/dist/contract.js CHANGED
@@ -896,6 +896,89 @@ const VETTED_IMPORTS = [
896
896
  description:
897
897
  "Native haptic feedback. Pair with navigator.vibrate in widget.web.jsx.",
898
898
  },
899
+ // REQ-WSDK-PKG-EXPAND — curated cross-platform package expansion. Each entry
900
+ // below runs on web AND native (directly, or via the documented platform-split
901
+ // counterpart). Native-module packages additionally carry a pinned version in
902
+ // the compiler's generatePackageJson so a baked marketplace widget resolves in
903
+ // the Expo export (CLAUDE.md §3 parity). See the `adding-vetted-packages` skill
904
+ // for the full add checklist (contract ×2, version bump, compiler pin, docs).
905
+ {
906
+ specifier: "react-native-reanimated",
907
+ platforms: ["web", "native"],
908
+ category: "animation",
909
+ description:
910
+ "Declarative, performant animations. Works on both platforms; the export always emits the required react-native-reanimated/plugin in babel.config.js so a widget using worklets bundles on native.",
911
+ },
912
+ {
913
+ specifier: "react-native-gesture-handler",
914
+ platforms: ["web", "native"],
915
+ category: "gesture",
916
+ description:
917
+ "Native-driven touch gestures (pan, pinch, swipe, long-press). Works on both platforms; wrap interactive trees in GestureHandlerRootView.",
918
+ },
919
+ {
920
+ specifier: "react-native-safe-area-context",
921
+ platforms: ["web", "native"],
922
+ category: "layout",
923
+ description:
924
+ "Safe-area insets (notch / status bar). useSafeAreaInsets() returns zeros on web and the real insets on native, so the same layout code is safe on both.",
925
+ },
926
+ {
927
+ specifier: "@shopify/flash-list",
928
+ platforms: ["web", "native"],
929
+ category: "list",
930
+ description:
931
+ "High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms.",
932
+ },
933
+ {
934
+ specifier: "react-native-paper",
935
+ platforms: ["web", "native"],
936
+ category: "ui",
937
+ description:
938
+ "Material Design component library built on react-native + react-native-web, so the same components render identically on both platforms.",
939
+ },
940
+ {
941
+ specifier: "react-native-vector-icons",
942
+ platforms: ["web", "native"],
943
+ category: "iconography",
944
+ description:
945
+ "Icon font families (MaterialIcons, FontAwesome, Ionicons, …). Works on both platforms; prefer the SDK's <Icon> (lucide) primitive for the common case.",
946
+ },
947
+ {
948
+ specifier: "@react-native-community/slider",
949
+ platforms: ["web", "native"],
950
+ category: "input",
951
+ description:
952
+ "Cross-platform slider input. Controlled — value + onValueChange. Works on both platforms.",
953
+ },
954
+ {
955
+ specifier: "expo-linear-gradient",
956
+ platforms: ["web", "native"],
957
+ category: "drawing",
958
+ description:
959
+ "Linear-gradient fill (<LinearGradient colors={[...]} />). The cross-platform gradient — works on both platforms (react-native-linear-gradient is native-only; prefer this).",
960
+ },
961
+ {
962
+ specifier: "lottie-react-native",
963
+ platforms: ["native"],
964
+ category: "animation",
965
+ description:
966
+ "After Effects (Bodymovin) JSON animations. Native-only; pair with lottie-react in widget.web.jsx for the web variant.",
967
+ },
968
+ {
969
+ specifier: "lottie-react",
970
+ platforms: ["web"],
971
+ category: "animation",
972
+ description:
973
+ "Web Lottie player. Web-only counterpart to lottie-react-native; bundle it into widget.web.jsx.",
974
+ },
975
+ {
976
+ specifier: "react-native-webview",
977
+ platforms: ["native"],
978
+ category: "media",
979
+ description:
980
+ "Embeds web content in a native WebView. Native-only; on web render an <iframe> (or a View with the URL) in widget.web.jsx.",
981
+ },
899
982
  ];
900
983
 
901
984
  const ALLOWED_BARE_IMPORTS = VETTED_IMPORTS.map((v) => v.specifier);
@@ -995,7 +1078,18 @@ const CONTRACT = deepFreeze({
995
1078
  // cascading dropdowns; tenant-copy remaps `tableId` and nulls `recordId`
996
1079
  // (records are business data, never copied). No existing type changed
997
1080
  // shape, so this is additive — minor bump on the pre-1.0 channel.
998
- version: "1.12.0",
1081
+ //
1082
+ // 1.13.0: additive (REQ-WSDK-PKG-EXPAND) — the vetted import allowlist gains
1083
+ // a curated cross-platform package set: react-native-reanimated,
1084
+ // react-native-gesture-handler, react-native-safe-area-context,
1085
+ // @shopify/flash-list, react-native-paper, react-native-vector-icons,
1086
+ // @react-native-community/slider, expo-linear-gradient, react-native-webview,
1087
+ // and lottie-react-native (+ lottie-react as its web counterpart). No
1088
+ // existing entry changed shape and no other contract field moved, so this
1089
+ // is additive — minor bump on the pre-1.0 channel. The compiler pins the
1090
+ // native-module members in the exported Expo app's package.json and now
1091
+ // always emits the react-native-reanimated/plugin (CLAUDE.md §3 parity).
1092
+ version: "1.13.0",
999
1093
  hooks: HOOKS,
1000
1094
  primitives: PRIMITIVES,
1001
1095
  manifestSchema: MANIFEST_SCHEMA,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",