@nswds/app 2.0.2 → 3.0.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 CHANGED
@@ -15,18 +15,25 @@ npm install @nswds/app
15
15
  `@nswds/app` does not bundle React or Next.js — it expects your application to
16
16
  provide them, so that only one copy of React is ever loaded:
17
17
 
18
- | Package | Required version |
19
- | ------------- | ---------------- |
20
- | `react` | `^19.2.6` |
21
- | `react-dom` | `^19.2.6` |
22
- | `next` | `^16.2.6` |
23
- | `next-themes` | `^0.4.6` |
18
+ | Package | Required version |
19
+ | ----------------- | ---------------- |
20
+ | `react` | `^19.2.6` |
21
+ | `react-dom` | `^19.2.6` |
22
+ | `next` | `^16.2.6` |
23
+ | `next-themes` | `^0.4.6` |
24
+ | `react-hook-form` | `^7.75.0` |
24
25
 
25
26
  npm 7 and later install missing peer dependencies automatically. If your project
26
27
  is on an older version of React or Next.js, `npm install` will report an
27
28
  `ERESOLVE` conflict — upgrade rather than using `--legacy-peer-deps`, since two
28
29
  copies of React break hooks at runtime.
29
30
 
31
+ `react-hook-form` is a peer for the same reason as `next-themes`: `Form` is
32
+ `FormProvider`, and `useFormField` calls `useFormContext()`, so the `useForm()`
33
+ control object you create must resolve to the same copy of the library that the
34
+ components read. Two copies mean two React contexts, and the fields silently see
35
+ a form you never populated.
36
+
30
37
  Everything else the components need is a regular dependency and is installed for
31
38
  you.
32
39
 
package/dist/index.cjs CHANGED
@@ -64,7 +64,7 @@ var oneDark = require('react-syntax-highlighter/dist/esm/styles/prism/one-dark')
64
64
  var oneLight = require('react-syntax-highlighter/dist/esm/styles/prism/one-light');
65
65
  var tokenlens = require('tokenlens');
66
66
  var useStickToBottom = require('use-stick-to-bottom');
67
- var crypto = require('crypto');
67
+ var nanoid = require('nanoid');
68
68
  var streamdown = require('streamdown');
69
69
  var slugify = require('@sindresorhus/slugify');
70
70
  var zustand = require('zustand');
@@ -126,7 +126,6 @@ var ResizablePrimitive__namespace = /*#__PURE__*/_interopNamespace(ResizablePrim
126
126
  var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
127
127
  var oneDark__default = /*#__PURE__*/_interopDefault(oneDark);
128
128
  var oneLight__default = /*#__PURE__*/_interopDefault(oneLight);
129
- var crypto__default = /*#__PURE__*/_interopDefault(crypto);
130
129
 
131
130
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
132
131
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -14470,7 +14469,7 @@ function FormatToggle({ format, setFormat }) {
14470
14469
 
14471
14470
  // package.json
14472
14471
  var package_default = {
14473
- version: "2.0.2"};
14472
+ version: "3.0.1"};
14474
14473
  var SluggerContext = React5__namespace.default.createContext(null);
14475
14474
  function flattenText(nodes) {
14476
14475
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -18998,10 +18997,8 @@ var acceleratedValues = /* @__PURE__ */ new Set([
18998
18997
  "opacity",
18999
18998
  "clipPath",
19000
18999
  "filter",
19001
- "transform"
19002
- // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
19003
- // or until we implement support for linear() easing.
19004
- // "background-color"
19000
+ "transform",
19001
+ "backgroundColor"
19005
19002
  ]);
19006
19003
 
19007
19004
  // node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs
@@ -19032,7 +19029,7 @@ var supportsWaapi = /* @__PURE__ */ memo(() => Object.hasOwnProperty.call(Elemen
19032
19029
  function supportsBrowserAnimation(options) {
19033
19030
  const { motionValue: motionValue2, name, repeatDelay, repeatType, damping, type, keyframes: keyframes2 } = options;
19034
19031
  const subject = motionValue2?.owner?.current;
19035
- if (!(subject instanceof HTMLElement)) {
19032
+ if (!(subject instanceof HTMLElement) && !(subject instanceof SVGElement)) {
19036
19033
  return false;
19037
19034
  }
19038
19035
  const { onUpdate, transformTemplate } = motionValue2.owner.getProps();
@@ -21389,6 +21386,10 @@ var HTMLVisualElement = class extends DOMVisualElement {
21389
21386
  this.type = "html";
21390
21387
  this.renderInstance = renderHTML;
21391
21388
  }
21389
+ mount(instance) {
21390
+ invariant(Boolean(instance.style), "motion.create() components must forward their ref to a HTML or SVG element", "custom-component-ref");
21391
+ super.mount(instance);
21392
+ }
21392
21393
  readValueFromInstance(instance, key) {
21393
21394
  if (transformProps.has(key)) {
21394
21395
  return this.projection?.isProjecting ? defaultTransformValue(key) : readTransformValue(instance, key);
@@ -30684,39 +30685,6 @@ var OpenInv0 = (props) => {
30684
30685
  }
30685
30686
  ) });
30686
30687
  };
30687
-
30688
- // node_modules/nanoid/url-alphabet/index.js
30689
- var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
30690
-
30691
- // node_modules/nanoid/index.js
30692
- var POOL_SIZE_MULTIPLIER = 128;
30693
- var pool;
30694
- var poolOffset;
30695
- var fillPool = (bytes) => {
30696
- if (bytes < 0) throw new RangeError("Wrong ID size");
30697
- try {
30698
- if (!pool || pool.length < bytes) {
30699
- pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
30700
- crypto__default.default.randomFillSync(pool);
30701
- poolOffset = 0;
30702
- } else if (poolOffset + bytes > pool.length) {
30703
- crypto__default.default.randomFillSync(pool);
30704
- poolOffset = 0;
30705
- }
30706
- } catch (e) {
30707
- pool = void 0;
30708
- throw e;
30709
- }
30710
- poolOffset += bytes;
30711
- };
30712
- var nanoid = (size = 21) => {
30713
- fillPool(size |= 0);
30714
- let id3 = "";
30715
- for (let i = poolOffset - size; i < poolOffset; i++) {
30716
- id3 += urlAlphabet[pool[i] & 63];
30717
- }
30718
- return id3;
30719
- };
30720
30688
  function Textarea2({ className, ...props }) {
30721
30689
  return /* @__PURE__ */ jsxRuntime.jsx(
30722
30690
  "textarea",
@@ -30894,7 +30862,7 @@ var PromptInput = ({
30894
30862
  const next = [];
30895
30863
  for (const file of capped) {
30896
30864
  next.push({
30897
- id: nanoid(),
30865
+ id: nanoid.nanoid(),
30898
30866
  type: "file",
30899
30867
  url: URL.createObjectURL(file),
30900
30868
  mediaType: file.type,