@plasmicapp/react-web 0.2.99 → 0.2.102

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.
Files changed (61) hide show
  1. package/dist/all.d.ts +21 -2
  2. package/dist/index.d.ts +1 -0
  3. package/dist/react-web.cjs.development.js +342 -4
  4. package/dist/react-web.cjs.development.js.map +1 -1
  5. package/dist/react-web.cjs.production.min.js +1 -1
  6. package/dist/react-web.cjs.production.min.js.map +1 -1
  7. package/dist/react-web.esm.js +342 -5
  8. package/dist/react-web.esm.js.map +1 -1
  9. package/dist/render/PlasmicImg/index.d.ts +6 -1
  10. package/dist/states/index.d.ts +15 -0
  11. package/package.json +6 -3
  12. package/skinny/dist/index.d.ts +1 -0
  13. package/skinny/dist/render/PlasmicImg/index.d.ts +6 -1
  14. package/skinny/dist/render/PlasmicImg/index.js +12 -4
  15. package/skinny/dist/render/PlasmicImg/index.js.map +1 -1
  16. package/skinny/dist/states/index.d.ts +15 -0
  17. package/skinny/dist/collection-utils-3487dd27.js +0 -238
  18. package/skinny/dist/collection-utils-3487dd27.js.map +0 -1
  19. package/skinny/dist/collection-utils-47e89cbe.js +0 -238
  20. package/skinny/dist/collection-utils-47e89cbe.js.map +0 -1
  21. package/skinny/dist/collection-utils-4dae6efa.js +0 -292
  22. package/skinny/dist/collection-utils-4dae6efa.js.map +0 -1
  23. package/skinny/dist/collection-utils-57ec40f9.js +0 -292
  24. package/skinny/dist/collection-utils-57ec40f9.js.map +0 -1
  25. package/skinny/dist/collection-utils-96cde83c.js +0 -238
  26. package/skinny/dist/collection-utils-96cde83c.js.map +0 -1
  27. package/skinny/dist/collection-utils-b0b8f30e.js +0 -291
  28. package/skinny/dist/collection-utils-b0b8f30e.js.map +0 -1
  29. package/skinny/dist/plume-utils-5c413fd1.js +0 -35
  30. package/skinny/dist/plume-utils-5c413fd1.js.map +0 -1
  31. package/skinny/dist/props-utils-4633caf6.js +0 -8
  32. package/skinny/dist/props-utils-4633caf6.js.map +0 -1
  33. package/skinny/dist/props-utils-5c0ad25a.js +0 -59
  34. package/skinny/dist/props-utils-5c0ad25a.js.map +0 -1
  35. package/skinny/dist/props-utils-754f655a.js +0 -39
  36. package/skinny/dist/props-utils-754f655a.js.map +0 -1
  37. package/skinny/dist/props-utils-c632595f.js +0 -59
  38. package/skinny/dist/props-utils-c632595f.js.map +0 -1
  39. package/skinny/dist/props-utils-fd5f444e.js +0 -59
  40. package/skinny/dist/props-utils-fd5f444e.js.map +0 -1
  41. package/skinny/dist/react-utils-118d8539.js +0 -190
  42. package/skinny/dist/react-utils-118d8539.js.map +0 -1
  43. package/skinny/dist/react-utils-2a2fd6c9.js +0 -339
  44. package/skinny/dist/react-utils-2a2fd6c9.js.map +0 -1
  45. package/skinny/dist/react-utils-2d70bbbe.js +0 -172
  46. package/skinny/dist/react-utils-2d70bbbe.js.map +0 -1
  47. package/skinny/dist/react-utils-675565b4.js +0 -334
  48. package/skinny/dist/react-utils-675565b4.js.map +0 -1
  49. package/skinny/dist/render/PlasmicImg.d.ts +0 -62
  50. package/skinny/dist/ssr-64e38713.js +0 -108
  51. package/skinny/dist/ssr-64e38713.js.map +0 -1
  52. package/skinny/dist/ssr-902d1292.js +0 -105
  53. package/skinny/dist/ssr-902d1292.js.map +0 -1
  54. package/skinny/dist/ssr-a8081074.js +0 -108
  55. package/skinny/dist/ssr-a8081074.js.map +0 -1
  56. package/skinny/dist/ssr-d2fd94f2.js +0 -31
  57. package/skinny/dist/ssr-d2fd94f2.js.map +0 -1
  58. package/skinny/dist/tslib.es6-00014098.js +0 -148
  59. package/skinny/dist/tslib.es6-00014098.js.map +0 -1
  60. package/skinny/dist/tslib.es6-73236e8e.js +0 -141
  61. package/skinny/dist/tslib.es6-73236e8e.js.map +0 -1
package/dist/all.d.ts CHANGED
@@ -106,7 +106,12 @@ interface PlasmicImgProps extends ImgTagProps {
106
106
  * or just a src string with unknown intrinsic dimensions.
107
107
  */
108
108
  src?: string | {
109
- src: string;
109
+ src: string | {
110
+ src: string;
111
+ height: number;
112
+ width: number;
113
+ blurDataURL?: string;
114
+ };
110
115
  fullHeight: number;
111
116
  fullWidth: number;
112
117
  aspectRatio?: number;
@@ -1177,4 +1182,18 @@ declare function useTriggeredOverlay<P extends BaseTriggeredOverlayProps, C exte
1177
1182
  };
1178
1183
  };
1179
1184
 
1180
- export { BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, getDataProps, hasVariant, makeFragment, omit, pick, renderPlasmicSlot, setPlumeStrictMode, useButton, useCheckbox, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
1185
+ interface $State {
1186
+ [key: string]: any;
1187
+ }
1188
+ interface $StateSpec<T> {
1189
+ path: string;
1190
+ initFunc?: ($props: Record<string, any>, $state: $State) => T;
1191
+ initVal?: T;
1192
+ type: "private" | "readonly" | "writable";
1193
+ valueProp?: string;
1194
+ onChangeProp?: string;
1195
+ }
1196
+ declare function useVanillaDollarState(specs: $StateSpec<any>[], props: Record<string, any>): $State;
1197
+ declare const useDollarState: typeof useVanillaDollarState;
1198
+
1199
+ export { BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, getDataProps, hasVariant, makeFragment, omit, pick, renderPlasmicSlot, setPlumeStrictMode, useButton, useCheckbox, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
package/dist/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from "./plume/select";
9
9
  export * from "./plume/switch";
10
10
  export * from "./plume/text-input";
11
11
  export * from "./plume/triggered-overlay";
12
+ export { default as useDollarState } from "./states/index";
@@ -25,6 +25,8 @@ var listbox = require('@react-aria/listbox');
25
25
  var select$1 = require('@react-stately/select');
26
26
  var _switch = require('@react-aria/switch');
27
27
  var overlays = require('@react-aria/overlays');
28
+ var get = _interopDefault(require('dlv'));
29
+ var dset = require('dset');
28
30
 
29
31
  function _extends() {
30
32
  _extends = Object.assign || function (target) {
@@ -852,7 +854,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
852
854
  fullHeight = _ref.fullHeight,
853
855
  aspectRatio = _ref.aspectRatio;
854
856
 
855
- var srcStr = src ? typeof src === "string" ? src : src.src : ""; // Assume external image if either dimension is null and use usual <img>
857
+ var srcStr = src ? typeof src === "string" ? src : typeof src.src === "string" ? src.src : src.src.src : ""; // Assume external image if either dimension is null and use usual <img>
856
858
 
857
859
  if (fullHeight == null || fullWidth == null) {
858
860
  return React__default.createElement("img", Object.assign({
@@ -869,6 +871,8 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
869
871
  displayWidth = "100%";
870
872
  }
871
873
 
874
+ var computedDisplayWidth = displayWidth;
875
+
872
876
  if (fullWidth && fullHeight && (!displayWidth || displayWidth === "auto") && !!getPixelLength(displayHeight)) {
873
877
  // If there's a pixel length specified for displayHeight but not displayWidth,
874
878
  // then we can derive the pixel length for displayWidth. Having an explicit
@@ -878,7 +882,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
878
882
  // We shouldn't do it for SVGs though, because `fullWidth` and
879
883
  // `fullHeight` might have rounded values so the final
880
884
  // `displayWidth` could differ by 1px or so.
881
- displayWidth = getPixelLength(displayHeight) * fullWidth / fullHeight;
885
+ computedDisplayWidth = getPixelLength(displayHeight) * fullWidth / fullHeight;
882
886
  }
883
887
  }
884
888
 
@@ -894,7 +898,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
894
898
  spacerHeight = Math.round(spacerWidth / aspectRatio);
895
899
  }
896
900
 
897
- var _getWidths = getWidths(displayWidth, fullWidth, {
901
+ var _getWidths = getWidths(computedDisplayWidth, fullWidth, {
898
902
  minWidth: displayMinWidth
899
903
  }),
900
904
  sizes = _getWidths.sizes,
@@ -906,7 +910,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
906
910
 
907
911
  var wrapperStyle = _extends({}, style || {});
908
912
 
909
- var spacerStyle = pick(style || {}, "objectFit", "objectPosition");
913
+ var spacerStyle = _extends({}, pick(style || {}, "objectFit", "objectPosition"));
910
914
 
911
915
  if (displayWidth != null && displayWidth !== "auto") {
912
916
  // If width is set, set it on the wrapper along with min/max width
@@ -3120,6 +3124,339 @@ function useTriggeredOverlay(plasmicClass, props, config, outerRef) {
3120
3124
  };
3121
3125
  }
3122
3126
 
3127
+ var UNINITIALIZED = /*#__PURE__*/Symbol("plasmic.unitialized");
3128
+ function keyBy(list, keyFunc) {
3129
+ var keyedObject = {};
3130
+
3131
+ for (var _iterator = _createForOfIteratorHelperLoose(list), _step; !(_step = _iterator()).done;) {
3132
+ var val = _step.value;
3133
+ keyedObject[keyFunc(val)] = val;
3134
+ }
3135
+
3136
+ return keyedObject;
3137
+ }
3138
+
3139
+ function getObjectAtPath($state, path) {
3140
+ var parts = path.split(".");
3141
+ var parts2 = parts.slice(0, parts.length - 1);
3142
+
3143
+ if (parts2.length === 0) {
3144
+ return $state;
3145
+ }
3146
+
3147
+ var existing = get($state, parts2);
3148
+
3149
+ if (existing) {
3150
+ return existing;
3151
+ }
3152
+
3153
+ var newObj = {};
3154
+ dset.dset($state, parts2, newObj);
3155
+ return newObj;
3156
+ }
3157
+
3158
+ function isRendering() {
3159
+ return !!React__default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current;
3160
+ }
3161
+
3162
+ function shallowEqual(a1, a2) {
3163
+ if (a1.length !== a2.length) {
3164
+ return false;
3165
+ }
3166
+
3167
+ for (var i = 0; i < a1.length; i++) {
3168
+ if (a1[i] !== a2[i]) {
3169
+ return false;
3170
+ }
3171
+ }
3172
+
3173
+ return true;
3174
+ }
3175
+
3176
+ function useVanillaDollarState(specs, props) {
3177
+ var _React$useState = React__default.useState(function () {
3178
+ return {
3179
+ stateValues: Object.fromEntries(specs.map(function (spec) {
3180
+ return [spec.path, // If the initial value depends on initFunc, then we initialize
3181
+ // it to this special UNINITIALIZED symbol. We can't just run
3182
+ // spec.initFunc() here, because the expression may read from
3183
+ // $state, which is not yet initialized. Instead, we will
3184
+ // lazily compute and initialize this at get() time.
3185
+ spec.initFunc ? UNINITIALIZED : spec.initVal];
3186
+ })),
3187
+ initStateValues: Object.fromEntries(specs.filter(function (spec) {
3188
+ return !spec.initFunc;
3189
+ }).map(function (spec) {
3190
+ return [spec.path, spec.initVal];
3191
+ })),
3192
+ initStateDeps: {},
3193
+ fireOnChange: {}
3194
+ };
3195
+ }),
3196
+ _$$state = _React$useState[0],
3197
+ set$$State = _React$useState[1]; // We have a weird scheme here to reduce the number of state updates.
3198
+ // Whenever user does a $state get() or set(), we may end up initializing
3199
+ // a bunch of values. We don't want to call set$$State() a bunch of times.
3200
+ // Instead, we will fork as we need to, and call set$$State() at the end of
3201
+ // the hook and at the end of get() / set() as appropriate.
3202
+ // $$state here is going to be copied-on-write; once copied, it will
3203
+ // be directly mutated. Since $state will always be directly proxying $$state,
3204
+ // that means you can "read what you wrote": after $state.count = $state.count + 1,
3205
+ // if you read $state.count again, it will reflect the latest value.
3206
+ //
3207
+ // There are three places where we might actually call set$$State():
3208
+ // 1. At the end of a "top-level" get(): we may have ended up initializing
3209
+ // some state values.
3210
+ // 2. At the end of a "top-level" set(): we mutated this value, but also
3211
+ // may have reset some other state values that depended on this one.
3212
+ // 3. At the end of the hook, where we compare the new initial value with
3213
+ // the previous initial value.
3214
+
3215
+
3216
+ var $$state = _extends({}, _$$state);
3217
+
3218
+ var dirtyFields = {
3219
+ stateValues: false,
3220
+ initStateValues: false,
3221
+ initStateDeps: false,
3222
+ fireOnChange: false
3223
+ };
3224
+
3225
+ function makeDirty(field, copy) {
3226
+ if (!dirtyFields[field]) {
3227
+ dirtyFields[field] = true;
3228
+ $$state[field] = copy($$state[field]);
3229
+ }
3230
+ }
3231
+
3232
+ function updateStateValue(path, value) {
3233
+ makeDirty("stateValues", function (x) {
3234
+ return _extends({}, x);
3235
+ });
3236
+ console.log("UPDATE state value:", path, value);
3237
+ $$state.stateValues[path] = value; // If any other state depends on this one, then reset their
3238
+ // values to their initial as well
3239
+
3240
+ for (var _i = 0, _Object$entries = Object.entries($$state.initStateDeps); _i < _Object$entries.length; _i++) {
3241
+ var _Object$entries$_i = _Object$entries[_i],
3242
+ key = _Object$entries$_i[0],
3243
+ deps = _Object$entries$_i[1];
3244
+
3245
+ if (deps.includes(path)) {
3246
+ resetPath(key);
3247
+ }
3248
+ }
3249
+
3250
+ var spec = specByPath[path];
3251
+
3252
+ if (spec.onChangeProp) {
3253
+ if (isRendering()) {
3254
+ // If we're currently rendering this component, then we
3255
+ // CANNOT fire the event handler, as it is illegal to set
3256
+ // the state of another component during rendering.
3257
+ // Instead, we save it into our internal state, and fire
3258
+ // it later in a layout effect.
3259
+ updateFireOnChange(spec.path, value);
3260
+ } else {
3261
+ var _props$spec$onChangeP;
3262
+
3263
+ // Most of the time, state changes outside of rendering
3264
+ // (in an event handler), and we just directly call the
3265
+ // onChange
3266
+ (_props$spec$onChangeP = props[spec.onChangeProp]) == null ? void 0 : _props$spec$onChangeP.call(props, value);
3267
+ }
3268
+ }
3269
+ }
3270
+
3271
+ function updateInitStateValue(path, value) {
3272
+ makeDirty("initStateValues", function (x) {
3273
+ return _extends({}, x);
3274
+ });
3275
+ console.log("UPDATE initValue:", path, value);
3276
+ $$state.initStateValues[path] = value;
3277
+ }
3278
+
3279
+ function updateInitStateDeps(path, deps) {
3280
+ makeDirty("initStateDeps", function (x) {
3281
+ return _extends({}, x);
3282
+ });
3283
+ console.log("UPDATE DEPS: " + path, deps);
3284
+ $$state.initStateDeps[path] = deps;
3285
+ }
3286
+
3287
+ function updateInternalStateIfDirty() {
3288
+ if (Object.values(dirtyFields).some(function (x) {
3289
+ return x;
3290
+ })) {
3291
+ console.log("UPDATE $$STATE");
3292
+ set$$State($$state);
3293
+ }
3294
+ }
3295
+
3296
+ function updateFireOnChange(path, value) {
3297
+ makeDirty("fireOnChange", function (x) {
3298
+ return _extends({}, x);
3299
+ });
3300
+ $$state.fireOnChange[path] = value;
3301
+ }
3302
+
3303
+ console.log("useDollarState", _extends({}, _$$state));
3304
+ var specByPath = React__default.useMemo(function () {
3305
+ return keyBy(specs, function (spec) {
3306
+ return spec.path;
3307
+ });
3308
+ }, [specs]);
3309
+ var stateAccessStack = [{}];
3310
+ var $props = props;
3311
+ /**
3312
+ * Runs spec.initFunc, keeping track of the state accesses
3313
+ * that occurred while running it
3314
+ */
3315
+
3316
+ function trackedInit(spec) {
3317
+ var _$$state$initStateDep;
3318
+
3319
+ var stateAccess = {};
3320
+ stateAccessStack.push(stateAccess);
3321
+ var res = spec.initFunc($props, $state);
3322
+ var deps = Object.keys(stateAccess);
3323
+
3324
+ if (!shallowEqual(deps, (_$$state$initStateDep = $$state.initStateDeps[spec.path]) != null ? _$$state$initStateDep : [])) {
3325
+ updateInitStateDeps(spec.path, deps);
3326
+ }
3327
+
3328
+ stateAccessStack.pop();
3329
+ return res;
3330
+ }
3331
+ /**
3332
+ * Resets the value for this state
3333
+ */
3334
+
3335
+
3336
+ function resetPath(path) {
3337
+ // Resets the value for this state
3338
+ var spec = specByPath[path];
3339
+ var initValue = trackedInit(spec);
3340
+
3341
+ if (initValue !== $$state.stateValues[spec.path]) {
3342
+ updateStateValue(spec.path, initValue);
3343
+ }
3344
+
3345
+ if (initValue !== $$state.initStateValues[spec.path]) {
3346
+ updateInitStateValue(spec.path, initValue);
3347
+ }
3348
+
3349
+ return initValue;
3350
+ } // Since a get() or a set() may result in other get() or set(),
3351
+ // we keep track of whether we're at the "top-level" so we know
3352
+ // whether to update state at the end.
3353
+
3354
+
3355
+ var accessLevel = 0;
3356
+ var $state = {};
3357
+
3358
+ var _loop = function _loop() {
3359
+ var spec = _step2.value;
3360
+ var parts = spec.path.split(".");
3361
+ var name = parts[parts.length - 1];
3362
+ var obj = getObjectAtPath($state, spec.path); // Define get() and set() for this state cell
3363
+
3364
+ Object.defineProperty(obj, name, {
3365
+ get: function get() {
3366
+ if (spec.valueProp) {
3367
+ return props[spec.valueProp];
3368
+ }
3369
+
3370
+ accessLevel += 1;
3371
+ var value = $$state.stateValues[spec.path];
3372
+
3373
+ if (value === UNINITIALIZED) {
3374
+ // This value has a init expression; need to be evaluated.
3375
+ value = resetPath(spec.path);
3376
+ } // Record that this field had just been accessed; for
3377
+ // trackInit() to know what fields were used to compute
3378
+ // the init value
3379
+
3380
+
3381
+ stateAccessStack[stateAccessStack.length - 1][spec.path] = true;
3382
+ accessLevel -= 1;
3383
+
3384
+ if (accessLevel === 0) {
3385
+ updateInternalStateIfDirty();
3386
+ }
3387
+
3388
+ return value;
3389
+ },
3390
+ set: function set(newValue) {
3391
+ accessLevel += 1;
3392
+
3393
+ if (newValue !== $$state.stateValues[spec.path]) {
3394
+ updateStateValue(spec.path, newValue);
3395
+ }
3396
+
3397
+ accessLevel -= 1;
3398
+
3399
+ if (accessLevel === 0) {
3400
+ updateInternalStateIfDirty();
3401
+ }
3402
+ }
3403
+ });
3404
+ };
3405
+
3406
+ for (var _iterator2 = _createForOfIteratorHelperLoose(specs), _step2; !(_step2 = _iterator2()).done;) {
3407
+ _loop();
3408
+ } // For each spec with an initFunc, evaluate it and see if
3409
+ // the init value has changed. If so, reset its state.
3410
+
3411
+
3412
+ for (var _iterator3 = _createForOfIteratorHelperLoose(specs), _step3; !(_step3 = _iterator3()).done;) {
3413
+ var spec = _step3.value;
3414
+
3415
+ if (spec.initFunc) {
3416
+ var newInit = spec.initFunc($props, $state);
3417
+
3418
+ if (newInit !== $$state.initStateValues[spec.path]) {
3419
+ console.log("init changed for " + spec.path + " from " + $$state.initStateValues[spec.path] + " to " + newInit + "; resetting state");
3420
+ updateInitStateValue(spec.path, newInit);
3421
+ updateStateValue(spec.path, newInit);
3422
+
3423
+ if (spec.onChangeProp) {
3424
+ updateFireOnChange(spec.path, newInit);
3425
+ }
3426
+ }
3427
+ }
3428
+ }
3429
+
3430
+ var fireOnChange = $$state.fireOnChange;
3431
+ React__default.useLayoutEffect(function () {
3432
+ if (Object.keys(fireOnChange).length > 0) {
3433
+ for (var _i2 = 0, _Object$entries2 = Object.entries(fireOnChange); _i2 < _Object$entries2.length; _i2++) {
3434
+ var _Object$entries2$_i = _Object$entries2[_i2],
3435
+ path = _Object$entries2$_i[0],
3436
+ value = _Object$entries2$_i[1];
3437
+ var spec = specByPath[path];
3438
+
3439
+ if (spec.onChangeProp) {
3440
+ var _props$spec$onChangeP2;
3441
+
3442
+ (_props$spec$onChangeP2 = props[spec.onChangeProp]) == null ? void 0 : _props$spec$onChangeP2.call(props, value);
3443
+ }
3444
+ }
3445
+
3446
+ set$$State(function (prev) {
3447
+ return _extends({}, prev, {
3448
+ fireOnChange: {}
3449
+ });
3450
+ });
3451
+ }
3452
+ }, [fireOnChange, props, specByPath]); // update state if the above did some writes.
3453
+
3454
+ updateInternalStateIfDirty();
3455
+ return $state;
3456
+ }
3457
+
3458
+ var useDollarState = useVanillaDollarState;
3459
+
3123
3460
  exports.DropdownMenu = DropdownMenu;
3124
3461
  exports.PlasmicIcon = PlasmicIcon;
3125
3462
  exports.PlasmicImg = PlasmicImg;
@@ -3143,6 +3480,7 @@ exports.renderPlasmicSlot = renderPlasmicSlot;
3143
3480
  exports.setPlumeStrictMode = setPlumeStrictMode;
3144
3481
  exports.useButton = useButton;
3145
3482
  exports.useCheckbox = useCheckbox;
3483
+ exports.useDollarState = useDollarState;
3146
3484
  exports.useIsSSR = useIsSSR;
3147
3485
  exports.useMenu = useMenu;
3148
3486
  exports.useMenuButton = useMenuButton;