@noya-app/noya-api-client-react 0.1.52 → 0.1.54

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.
@@ -6,12 +6,12 @@ $ tsup src/index.ts --format cjs,esm --dts --sourcemap
6
6
  CJS Build start
7
7
  ESM Build start
8
8
  DTS Build start
9
- CJS dist/index.js 541.90 KB
10
- CJS dist/index.js.map 1.48 MB
11
- CJS ⚡️ Build success in 5349ms
12
- ESM dist/index.mjs 533.25 KB
13
- ESM dist/index.mjs.map 1.48 MB
14
- ESM ⚡️ Build success in 5353ms
15
- DTS ⚡️ Build success in 85609ms
9
+ CJS dist/index.js 542.70 KB
10
+ CJS dist/index.js.map 1.49 MB
11
+ CJS ⚡️ Build success in 4324ms
12
+ ESM dist/index.mjs 534.05 KB
13
+ ESM dist/index.mjs.map 1.49 MB
14
+ ESM ⚡️ Build success in 4330ms
15
+ DTS ⚡️ Build success in 87347ms
16
16
  DTS dist/index.d.ts 17.73 KB
17
17
  DTS dist/index.d.mts 17.73 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @noya-app/noya-api-client-react
2
2
 
3
+ ## 0.1.54
4
+
5
+ ### Patch Changes
6
+
7
+ - @noya-app/noya-api@0.1.54
8
+
9
+ ## 0.1.53
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [4f044b7]
14
+ - @noya-app/noya-utils@0.1.10
15
+ - @noya-app/noya-api@0.1.53
16
+
3
17
  ## 0.1.52
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -24,9 +24,9 @@ declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
24
24
  createdAt: string;
25
25
  url: string;
26
26
  description: string | null;
27
+ theme: any;
27
28
  updatedAt: string;
28
29
  icon: string | null;
29
- theme: any;
30
30
  assets: string[];
31
31
  slug: string | null;
32
32
  tagline: string | null;
@@ -57,9 +57,9 @@ declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
57
57
  createdAt: string;
58
58
  url: string;
59
59
  description: string | null;
60
+ theme: any;
60
61
  updatedAt: string;
61
62
  icon: string | null;
62
- theme: any;
63
63
  assets: string[];
64
64
  slug: string | null;
65
65
  tagline: string | null;
package/dist/index.d.ts CHANGED
@@ -24,9 +24,9 @@ declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
24
24
  createdAt: string;
25
25
  url: string;
26
26
  description: string | null;
27
+ theme: any;
27
28
  updatedAt: string;
28
29
  icon: string | null;
29
- theme: any;
30
30
  assets: string[];
31
31
  slug: string | null;
32
32
  tagline: string | null;
@@ -57,9 +57,9 @@ declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
57
57
  createdAt: string;
58
58
  url: string;
59
59
  description: string | null;
60
+ theme: any;
60
61
  updatedAt: string;
61
62
  icon: string | null;
62
- theme: any;
63
63
  assets: string[];
64
64
  slug: string | null;
65
65
  tagline: string | null;
package/dist/index.js CHANGED
@@ -5525,49 +5525,67 @@ var gistSchema = Type.Object({
5525
5525
 
5526
5526
  // ../noya-schemas/src/jsonSchema.ts
5527
5527
  var jsonSchema = Type.Recursive(
5528
- (This) => Type.Union(
5529
- [
5530
- Type.Object({
5531
- type: Type.Literal("string"),
5532
- default: Type.Optional(Type.String()),
5533
- _kind: Type.Literal("String")
5534
- }),
5535
- Type.Object({
5536
- type: Type.Literal("number"),
5537
- default: Type.Optional(Type.Number()),
5538
- minimum: Type.Optional(Type.Number()),
5539
- maximum: Type.Optional(Type.Number()),
5540
- _kind: Type.Literal("Number")
5541
- }),
5542
- Type.Object({
5543
- type: Type.Literal("boolean"),
5544
- default: Type.Optional(Type.Boolean()),
5545
- _kind: Type.Literal("Boolean")
5546
- }),
5547
- Type.Object({
5548
- type: Type.Literal("null"),
5549
- _kind: Type.Literal("Null")
5550
- }),
5551
- Type.Object({
5552
- type: Type.Literal("array"),
5553
- items: This,
5554
- // default: Type.Optional(Type.Array(Type.Any())),
5555
- // minItems: Type.Optional(Type.Number()),
5556
- // maxItems: Type.Optional(Type.Number()),
5557
- _kind: Type.Literal("Array")
5558
- }),
5559
- Type.Object({
5560
- type: Type.Literal("object"),
5561
- properties: Type.Record(Type.String(), This),
5562
- required: Type.Optional(Type.Array(Type.String())),
5563
- // default: Type.Optional(Type.Record(Type.String(), Type.Any())),
5564
- _kind: Type.Literal("Object")
5565
- })
5566
- ],
5567
- {
5568
- discriminator: "type"
5569
- }
5570
- ),
5528
+ (This) => Type.Union([
5529
+ Type.Object({
5530
+ type: Type.Literal("string"),
5531
+ default: Type.Optional(Type.String()),
5532
+ _kind: Type.Literal("String")
5533
+ }),
5534
+ Type.Object({
5535
+ type: Type.Literal("number"),
5536
+ default: Type.Optional(Type.Number()),
5537
+ minimum: Type.Optional(Type.Number()),
5538
+ maximum: Type.Optional(Type.Number()),
5539
+ _kind: Type.Literal("Number")
5540
+ }),
5541
+ Type.Object({
5542
+ type: Type.Literal("boolean"),
5543
+ default: Type.Optional(Type.Boolean()),
5544
+ _kind: Type.Literal("Boolean")
5545
+ }),
5546
+ Type.Object({
5547
+ type: Type.Literal("null"),
5548
+ _kind: Type.Literal("Null")
5549
+ }),
5550
+ Type.Object({
5551
+ type: Type.Literal("array"),
5552
+ items: This,
5553
+ // default: Type.Optional(Type.Array(Type.Any())),
5554
+ // minItems: Type.Optional(Type.Number()),
5555
+ // maxItems: Type.Optional(Type.Number()),
5556
+ _kind: Type.Literal("Array")
5557
+ }),
5558
+ Type.Object({
5559
+ type: Type.Literal("object"),
5560
+ properties: Type.Record(Type.String(), This),
5561
+ required: Type.Optional(Type.Array(Type.String())),
5562
+ // default: Type.Optional(Type.Record(Type.String(), Type.Any())),
5563
+ _kind: Type.Literal("Object")
5564
+ }),
5565
+ Type.Object({
5566
+ const: Type.Union([
5567
+ Type.String(),
5568
+ Type.Number(),
5569
+ Type.Boolean(),
5570
+ Type.Null()
5571
+ ]),
5572
+ type: Type.Optional(
5573
+ Type.Union([
5574
+ Type.Literal("string"),
5575
+ Type.Literal("number"),
5576
+ Type.Literal("boolean"),
5577
+ Type.Literal("null")
5578
+ ])
5579
+ ),
5580
+ _kind: Type.Literal("Literal")
5581
+ }),
5582
+ Type.Object({
5583
+ anyOf: Type.Array(This, { minItems: 1 }),
5584
+ discriminator: Type.Optional(Type.String()),
5585
+ default: Type.Optional(Type.Any()),
5586
+ _kind: Type.Literal("Union")
5587
+ })
5588
+ ]),
5571
5589
  {
5572
5590
  $id: "jsonSchema"
5573
5591
  }
@@ -5649,6 +5667,13 @@ var SchemaTree = (0, import_tree_visit.defineTree)((schema) => {
5649
5667
  });
5650
5668
 
5651
5669
  // ../noya-schemas/src/resourceSchema.ts
5670
+ var targetFileSchema = Type.Object({
5671
+ id: Type.String(),
5672
+ toolId: Type.String(),
5673
+ tool: Type.Object({
5674
+ theme: Type.Optional(Type.Any())
5675
+ })
5676
+ });
5652
5677
  var baseSchemaProperties = {
5653
5678
  id: Type.String(),
5654
5679
  stableId: Type.String(),
@@ -5664,7 +5689,9 @@ var baseSchemaProperties = {
5664
5689
  })
5665
5690
  ),
5666
5691
  accessibleByFileVersionId: Nullable(Type.String()),
5667
- url: Type.Optional(Type.String())
5692
+ file: Type.Optional(Nullable(targetFileSchema)),
5693
+ url: Type.Optional(Type.String()),
5694
+ transformUrl: Type.Optional(Type.String())
5668
5695
  };
5669
5696
  var uploadableAssetSchema = Type.Object({
5670
5697
  content: Type.String(),
@@ -10524,12 +10551,19 @@ var createHash = (value, options) => (0, import_noya_utils7.hash)(value, { ...op
10524
10551
  // ../state-manager/src/GitManager.ts
10525
10552
  var import_observable10 = require("@noya-app/observable");
10526
10553
 
10527
- // ../state-manager/src/ImagePickerManager.ts
10528
- var import_observable11 = require("@noya-app/observable");
10554
+ // ../state-manager/src/ResourceManager.ts
10529
10555
  var import_noya_utils8 = require("@noya-app/noya-utils");
10556
+ var import_observable11 = require("@noya-app/observable");
10530
10557
 
10531
- // ../state-manager/src/IOManager.ts
10558
+ // ../state-manager/src/HostStorageManager.ts
10559
+ var import_noya_utils9 = require("@noya-app/noya-utils");
10560
+
10561
+ // ../state-manager/src/ImagePickerManager.ts
10532
10562
  var import_observable12 = require("@noya-app/observable");
10563
+ var import_noya_utils10 = require("@noya-app/noya-utils");
10564
+
10565
+ // ../state-manager/src/IOManager.ts
10566
+ var import_observable13 = require("@noya-app/observable");
10533
10567
 
10534
10568
  // ../state-manager/src/jwt.ts
10535
10569
  function base64UrlEncode(str) {
@@ -10631,18 +10665,18 @@ var jwt;
10631
10665
  })(jwt || (jwt = {}));
10632
10666
 
10633
10667
  // ../state-manager/src/MenuManager.ts
10634
- var import_noya_utils9 = require("@noya-app/noya-utils");
10635
- var import_observable13 = require("@noya-app/observable");
10668
+ var import_noya_utils11 = require("@noya-app/noya-utils");
10669
+ var import_observable14 = require("@noya-app/observable");
10636
10670
 
10637
10671
  // ../state-manager/src/NoyaManager.ts
10638
- var import_noya_utils19 = require("@noya-app/noya-utils");
10672
+ var import_noya_utils20 = require("@noya-app/noya-utils");
10639
10673
  var import_observable25 = require("@noya-app/observable");
10640
10674
 
10641
10675
  // ../noya-pipeline/src/graphToTasks.ts
10642
- var import_observable14 = require("@noya-app/observable");
10676
+ var import_observable15 = require("@noya-app/observable");
10643
10677
 
10644
10678
  // ../noya-pipeline/src/state.ts
10645
- var import_noya_utils10 = require("@noya-app/noya-utils");
10679
+ var import_noya_utils12 = require("@noya-app/noya-utils");
10646
10680
  var rectSchema = Type.Object({
10647
10681
  x: Type.Number(),
10648
10682
  y: Type.Number(),
@@ -10741,20 +10775,16 @@ var pipelineSchema = Type.Object(
10741
10775
  );
10742
10776
 
10743
10777
  // ../state-manager/src/PipelineManager.ts
10744
- var import_observable15 = require("@noya-app/observable");
10745
-
10746
- // ../state-manager/src/PublishingManager.ts
10747
10778
  var import_observable16 = require("@noya-app/observable");
10748
10779
 
10749
- // ../state-manager/src/ResourceManager.ts
10750
- var import_noya_utils11 = require("@noya-app/noya-utils");
10780
+ // ../state-manager/src/PublishingManager.ts
10751
10781
  var import_observable17 = require("@noya-app/observable");
10752
10782
 
10753
10783
  // ../state-manager/src/SandboxManager.ts
10754
10784
  var import_observable18 = require("@noya-app/observable");
10755
10785
 
10756
10786
  // ../state-manager/src/rpcManager.ts
10757
- var import_noya_utils12 = require("@noya-app/noya-utils");
10787
+ var import_noya_utils13 = require("@noya-app/noya-utils");
10758
10788
  var import_observable19 = require("@noya-app/observable");
10759
10789
 
10760
10790
  // ../state-manager/src/SecretManager.ts
@@ -10764,18 +10794,18 @@ var import_observable20 = require("@noya-app/observable");
10764
10794
  var import_observable21 = require("@noya-app/observable");
10765
10795
 
10766
10796
  // ../state-manager/src/TranscriptionManager.ts
10767
- var import_noya_utils13 = require("@noya-app/noya-utils");
10797
+ var import_noya_utils14 = require("@noya-app/noya-utils");
10768
10798
  var import_observable22 = require("@noya-app/observable");
10769
10799
 
10770
10800
  // ../state-manager/src/UserManager.ts
10771
10801
  var import_observable24 = require("@noya-app/observable");
10772
10802
 
10773
10803
  // ../state-manager/src/sync/clientId.ts
10774
- var import_noya_utils15 = require("@noya-app/noya-utils");
10804
+ var import_noya_utils16 = require("@noya-app/noya-utils");
10775
10805
  var import_observable23 = require("@noya-app/observable");
10776
10806
 
10777
10807
  // ../state-manager/src/sync/defaultNames.ts
10778
- var import_noya_utils14 = require("@noya-app/noya-utils");
10808
+ var import_noya_utils15 = require("@noya-app/noya-utils");
10779
10809
  var animals = [
10780
10810
  "cat",
10781
10811
  "dog",
@@ -10827,7 +10857,7 @@ function getClientImageUrl(animal) {
10827
10857
  }
10828
10858
  function randomClientIdentity() {
10829
10859
  const animal = randomElement(animals);
10830
- const name = `${(0, import_noya_utils14.upperFirst)(randomElement(adjectives))} ${(0, import_noya_utils14.upperFirst)(animal)}`;
10860
+ const name = `${(0, import_noya_utils15.upperFirst)(randomElement(adjectives))} ${(0, import_noya_utils15.upperFirst)(animal)}`;
10831
10861
  return {
10832
10862
  name,
10833
10863
  animal,
@@ -10868,7 +10898,7 @@ if (typeof window !== "undefined") {
10868
10898
  if (storedClientId) {
10869
10899
  clientId$.set(storedClientId);
10870
10900
  } else {
10871
- const newClientId = (0, import_noya_utils15.uuid)();
10901
+ const newClientId = (0, import_noya_utils16.uuid)();
10872
10902
  safeSetItem(CLIENT_ID_STORAGE_KEY, newClientId);
10873
10903
  clientId$.set(newClientId);
10874
10904
  }
@@ -10891,13 +10921,13 @@ if (typeof window !== "undefined") {
10891
10921
  }
10892
10922
 
10893
10923
  // ../state-manager/src/sync/syncUtils.ts
10894
- var import_noya_utils16 = require("@noya-app/noya-utils");
10924
+ var import_noya_utils17 = require("@noya-app/noya-utils");
10895
10925
 
10896
10926
  // ../state-manager/src/sync/localRpcHelpers.ts
10897
- var import_noya_utils17 = require("@noya-app/noya-utils");
10927
+ var import_noya_utils18 = require("@noya-app/noya-utils");
10898
10928
 
10899
10929
  // ../state-manager/src/sync/localStorageSync.ts
10900
- var import_noya_utils18 = require("@noya-app/noya-utils");
10930
+ var import_noya_utils19 = require("@noya-app/noya-utils");
10901
10931
 
10902
10932
  // ../noya-keymap/src/hooks.ts
10903
10933
  var import_react4 = require("react");
@@ -11195,7 +11225,7 @@ var FileDropTarget = memoGeneric(function FileDropTarget2({ children, onDropFile
11195
11225
  var import_react8 = require("react");
11196
11226
 
11197
11227
  // ../noya-react-utils/src/hooks/useDeepArray.ts
11198
- var import_noya_utils20 = require("@noya-app/noya-utils");
11228
+ var import_noya_utils21 = require("@noya-app/noya-utils");
11199
11229
  var import_react9 = require("react");
11200
11230
  function useJsonMemo(value) {
11201
11231
  const stringified = (0, import_react9.useMemo)(
@@ -11210,7 +11240,7 @@ function useJsonMemo(value) {
11210
11240
  }
11211
11241
 
11212
11242
  // ../noya-react-utils/src/hooks/useDeepState.ts
11213
- var import_noya_utils21 = require("@noya-app/noya-utils");
11243
+ var import_noya_utils22 = require("@noya-app/noya-utils");
11214
11244
  var import_react10 = require("react");
11215
11245
 
11216
11246
  // ../noya-react-utils/src/hooks/useFetch.ts
@@ -11241,7 +11271,7 @@ var import_react17 = require("react");
11241
11271
  var import_react18 = require("react");
11242
11272
 
11243
11273
  // ../noya-react-utils/src/hooks/useShallowArray.ts
11244
- var import_noya_utils22 = require("@noya-app/noya-utils");
11274
+ var import_noya_utils23 = require("@noya-app/noya-utils");
11245
11275
  var import_react19 = require("react");
11246
11276
 
11247
11277
  // ../noya-react-utils/src/hooks/useStableCallback.ts
@@ -11251,7 +11281,7 @@ var import_react20 = require("react");
11251
11281
  var import_react21 = require("react");
11252
11282
 
11253
11283
  // ../noya-react-utils/src/hooks/useUrlHashParameters.ts
11254
- var import_noya_utils23 = require("@noya-app/noya-utils");
11284
+ var import_noya_utils24 = require("@noya-app/noya-utils");
11255
11285
  var import_react22 = require("react");
11256
11286
 
11257
11287
  // ../noya-react-utils/src/hooks/useWindowSize.ts
@@ -11402,7 +11432,7 @@ var import_react58 = __toESM(require("react"));
11402
11432
  var import_client = require("react-dom/client");
11403
11433
 
11404
11434
  // ../noya-multiplayer-react/src/inspector/StateInspector.tsx
11405
- var import_noya_utils24 = require("@noya-app/noya-utils");
11435
+ var import_noya_utils25 = require("@noya-app/noya-utils");
11406
11436
  var import_react57 = __toESM(require("react"));
11407
11437
 
11408
11438
  // ../../node_modules/react-inspector/dist/index.mjs
@@ -14926,7 +14956,7 @@ var StateInspector = memoGeneric(function StateInspector2({
14926
14956
  {
14927
14957
  theme: theme3,
14928
14958
  onClick: async () => {
14929
- const path2 = prompt("Enter directory path") || (0, import_noya_utils24.uuid)();
14959
+ const path2 = prompt("Enter directory path") || (0, import_noya_utils25.uuid)();
14930
14960
  await resourceManager.createResource({
14931
14961
  type: "directory",
14932
14962
  path: path2
@@ -14942,9 +14972,9 @@ var StateInspector = memoGeneric(function StateInspector2({
14942
14972
  const file = await uploadFile();
14943
14973
  resourceManager.createResource({
14944
14974
  type: "asset",
14945
- path: file.name || (0, import_noya_utils24.uuid)(),
14975
+ path: file.name || (0, import_noya_utils25.uuid)(),
14946
14976
  asset: {
14947
- content: import_noya_utils24.Base64.encode(await file.arrayBuffer()),
14977
+ content: import_noya_utils25.Base64.encode(await file.arrayBuffer()),
14948
14978
  contentType: file.type,
14949
14979
  encoding: "base64"
14950
14980
  }
@@ -15197,7 +15227,7 @@ var StateInspector = memoGeneric(function StateInspector2({
15197
15227
  )
15198
15228
  );
15199
15229
  });
15200
- var truncateAsset = (0, import_noya_utils24.memoize)((asset) => {
15230
+ var truncateAsset = (0, import_noya_utils25.memoize)((asset) => {
15201
15231
  if (asset.url.startsWith("data:") || asset.url.startsWith("blob:")) {
15202
15232
  return { ...asset, url: ellipsis(asset.url, 40) };
15203
15233
  }