@agimon-ai/po-spreadsheet 0.0.1-alpha.1 → 0.0.1-alpha.11

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/LICENSE CHANGED
@@ -1,149 +1,110 @@
1
- License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
2
- "Business Source License" is a trademark of MariaDB Corporation Ab.
3
-
4
- Parameters
5
-
6
- Licensor: Agimon Pty Ltd
7
- Licensed Work: Po, the software in the Po source repository and the
8
- packages released from it, in each version released by
9
- the Licensor.
10
- The Licensed Work is (c) 2026 Agimon Pty Ltd.
11
- Material identified as third-party in the "Third-party
12
- components" section at the end of this file or in a
13
- NOTICE file, and any package or directory whose own
14
- license file grants a different license, is not part of
15
- the Licensed Work and remains under its own license.
16
- Additional Use Grant: You may make production use of the Licensed Work if
17
- your use is Eligible Use. "Eligible Use" is production use that falls
18
- within at least one of the following:
19
-
20
- (a) Personal Use. Use by an individual for their own personal purposes,
21
- and not on behalf of, or for the benefit of, an employer, client, or
22
- other Organization. Use by an individual in the course of employment
23
- or engagement by an Organization is use by that Organization.
24
-
25
- (b) Small Organization Use. Use by or on behalf of an Organization whose
26
- Annual Revenue is less than USD 1,000,000.
27
-
28
- (c) Non-profit, Education and Research Use. Use, regardless of Annual
29
- Revenue, by (i) an Organization registered or recognized as a
30
- non-profit or charitable organization under the laws of its
31
- jurisdiction, for its non-profit purposes; (ii) an accredited school,
32
- college, or university, for teaching, learning, or academic research;
33
- or (iii) a publicly funded research institution, for its research.
34
-
35
- (d) Service Provider Use. Use by a consultant, contractor, agency, or other
36
- service provider, regardless of its own Annual Revenue, solely to
37
- build, deploy, host, operate, or support the Licensed Work for a client
38
- whose own use would be Eligible Use under (a), (b), or (c). A service
39
- provider's use for its own purposes is Eligible Use only if the service
40
- provider itself qualifies under (b) or (c).
41
-
42
-
43
- Hosted services. Offering the Licensed Work to third parties as a hosted
44
- or managed service whose primary value is the Licensed Work is Eligible
45
- Use only if each such third party's own use would be Eligible Use.
46
-
47
- Definitions. "Organization" means any company, partnership, sole
48
- proprietorship, trust, association, government body, or other entity, and
49
- includes an individual acting in a business or professional capacity.
50
- "Affiliate" means any entity that directly or indirectly controls, is
51
- controlled by, or is under common control with an Organization, where
52
- "control" means ownership of more than 50% of the voting interests of an
53
- entity or the power to direct its management and policies by contract or
54
- otherwise. "Annual Revenue" means the total gross revenue of an
55
- Organization and all of its Affiliates combined, from all sources and
56
- whether or not related to the Licensed Work, for its most recently
57
- completed fiscal year, or, if it has not completed a fiscal year, for the
58
- twelve months before the use (or since its formation, if shorter),
59
- converted into US dollars at the average exchange rate for that period.
60
- Proceeds of equity or debt financing are not revenue.
61
-
62
- Threshold. If an Organization stops qualifying under (b), its existing
63
- production use remains Eligible Use for 90 days after it stops
64
- qualifying, after which it must obtain a commercial license or stop
65
- production use. Use that was Eligible Use when it occurred never requires
66
- a commercial license after the fact.
67
- Change Date: Four years from the date a version of the Licensed Work
68
- is first publicly released by the Licensor.
69
- Change License: Apache License, Version 2.0
70
-
71
- For information about alternative licensing arrangements for the Licensed
72
- Work, please visit: https://agimon.ai/licensing
73
-
74
- Notice
75
-
76
- The Business Source License (this document, or the "License") is not an Open
77
- Source license. However, the Licensed Work will eventually be made available
78
- under an Open Source License, as stated in this License.
79
-
80
- -----------------------------------------------------------------------------
81
-
82
- Business Source License 1.1
83
-
84
- Terms
85
-
86
- The Licensor hereby grants you the right to copy, modify, create derivative
87
- works, redistribute, and make non-production use of the Licensed Work. The
88
- Licensor may make an Additional Use Grant, above, permitting limited
89
- production use.
90
-
91
- Effective on the Change Date, or the fourth anniversary of the first publicly
92
- available distribution of a specific version of the Licensed Work under this
93
- License, whichever comes first, the Licensor hereby grants you rights under
94
- the terms of the Change License, and the rights granted in the paragraph
95
- above terminate.
96
-
97
- If your use of the Licensed Work does not comply with the requirements
98
- currently in effect as described in this License, you must purchase a
99
- commercial license from the Licensor, its affiliated entities, or authorized
100
- resellers, or you must refrain from using the Licensed Work.
101
-
102
- All copies of the original and modified Licensed Work, and derivative works
103
- of the Licensed Work, are subject to this License. This License applies
104
- separately for each version of the Licensed Work and the Change Date may vary
105
- for each version of the Licensed Work released by Licensor.
106
-
107
- You must conspicuously display this License on each original or modified copy
108
- of the Licensed Work. If you receive the Licensed Work in original or
109
- modified form from a third party, the terms and conditions set forth in this
110
- License apply to your use of that work.
111
-
112
- Any use of the Licensed Work in violation of this License will automatically
113
- terminate your rights under this License for the current and all other
114
- versions of the Licensed Work.
115
-
116
- This License does not grant you any right in any trademark or logo of
117
- Licensor or its affiliates (provided that you may use a trademark or logo of
118
- Licensor as expressly required by this License).
119
-
120
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
121
- AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
122
- EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
123
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
124
- TITLE.
125
-
126
- MariaDB hereby grants you permission to use this License’s text to license
127
- your works, and to refer to it using the trademark “Business Source License”,
128
- as long as you comply with the Covenants of Licensor below.
129
-
130
- Covenants of Licensor
131
-
132
- In consideration of the right to use this License’s text and the “Business
133
- Source License” name and trademark, Licensor covenants to MariaDB, and to all
134
- other recipients of the licensed work to be provided by Licensor:
135
-
136
- 1. To specify as the Change License the GPL Version 2.0 or any later version,
137
- or a license that is compatible with GPL Version 2.0 or a later version,
138
- where “compatible” means that software provided under the Change License can
139
- be included in a program with software provided under GPL Version 2.0 or a
140
- later version. Licensor may specify additional Change Licenses without
141
- limitation.
142
-
143
- 2. To either: (a) specify an additional grant of rights to use that does not
144
- impose any additional restriction on the right granted in this License, as
145
- the Additional Use Grant; or (b) insert the text “None”.
146
-
147
- 3. To specify a Change Date.
148
-
149
- 4. Not to modify this License in any other way.
1
+ # Functional Source License, Version 1.1, MIT Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Agimon Pty Ltd
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ SOFTWARE.
@@ -1,4 +1,4 @@
1
- import { createApiClient, defineFill, defineNativePlugin, nativeApiTransport, sessionApiAddress } from "@agimon-ai/po-core/native";
1
+ import { createApiClient, defineFill, defineNativePlugin, nativeApiTransport, sessionApiAddress, useT } from "@agimon-ai/po-core/native";
2
2
  import { DeviceEventEmitter } from "react-native";
3
3
  import { useCallback, useEffect, useState } from "react";
4
4
  import { View } from "react-native-unistyles/components/native/View";
@@ -63,12 +63,13 @@ const MIN_ROW = 44;
63
63
  * stay on the web for now.
64
64
  */
65
65
  function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection, draft, busy = false, onSelectSheet, onSelect, onDraft, onCommit, onAction }) {
66
+ const t = useT();
66
67
  if (state === "loading" || view === void 0) return /* @__PURE__ */ jsx(View, {
67
68
  style: styles.root,
68
69
  children: /* @__PURE__ */ jsx(Text, {
69
70
  accessibilityRole: state === "error" ? "alert" : void 0,
70
71
  style: [styles.note, state === "error" ? styles.red : null],
71
- children: state === "error" ? message?.text ?? "Po could not open this workbook." : "Opening workbook…"
72
+ children: state === "error" ? message?.text ?? t("spreadsheet.cannotOpen", "Po could not open this workbook.") : t("spreadsheet.opening", "Opening workbook…")
72
73
  })
73
74
  });
74
75
  const { sheet } = view;
@@ -91,18 +92,18 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
91
92
  style: styles.bar,
92
93
  contentContainerStyle: styles.toolbar,
93
94
  children: [
94
- action("insertRow", "Insert row", lineEdits),
95
- action("deleteRow", "Delete row", lineEdits),
96
- action("insertColumn", "Insert column", lineEdits),
97
- action("deleteColumn", "Delete column", lineEdits),
98
- action("addSheet", "Add sheet", !busy),
99
- action("undo", "Undo", !busy && view.revision > 0)
95
+ action("insertRow", t("spreadsheet.insertRow", "Insert row"), lineEdits),
96
+ action("deleteRow", t("spreadsheet.deleteRow", "Delete row"), lineEdits),
97
+ action("insertColumn", t("spreadsheet.insertColumn", "Insert column"), lineEdits),
98
+ action("deleteColumn", t("spreadsheet.deleteColumn", "Delete column"), lineEdits),
99
+ action("addSheet", t("spreadsheet.addSheet", "Add sheet"), !busy),
100
+ action("undo", t("spreadsheet.undo", "Undo"), !busy && view.revision > 0)
100
101
  ]
101
102
  }),
102
103
  /* @__PURE__ */ jsx(Text, {
103
104
  accessibilityRole: "text",
104
105
  style: styles.status,
105
- children: view.file.state === "saved" ? "Changes save to the file" : view.file.state === "readOnly" ? "Artifact: changes stay here" : "Not saved yet"
106
+ children: view.file.state === "saved" ? t("spreadsheet.saved", "Changes save to the file") : view.file.state === "readOnly" ? t("spreadsheet.artifactLocal", "Artifact: changes stay here") : t("spreadsheet.unsaved", "Not saved yet")
106
107
  }),
107
108
  /* @__PURE__ */ jsxs(View, {
108
109
  style: styles.field,
@@ -112,8 +113,8 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
112
113
  }), /* @__PURE__ */ jsx(Input, {
113
114
  size: "sm",
114
115
  style: styles.input,
115
- accessibilityLabel: "Cell contents",
116
- placeholder: selection === void 0 ? "Tap a cell" : void 0,
116
+ accessibilityLabel: t("spreadsheet.cellContents", "Cell contents"),
117
+ placeholder: selection === void 0 ? t("spreadsheet.tapCell", "Tap a cell") : void 0,
117
118
  disabled: !editable || selection === void 0,
118
119
  value: draft ?? active?.input ?? "",
119
120
  onFocus: () => {
@@ -129,30 +130,26 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
129
130
  children: [/* @__PURE__ */ jsx(LockIcon, {
130
131
  size: 16,
131
132
  color: "dim"
132
- }), /* @__PURE__ */ jsxs(Text, {
133
+ }), /* @__PURE__ */ jsx(Text, {
133
134
  style: [styles.note, styles.flex],
134
- children: [sheet.name, " is protected in the workbook, so Po keeps it read-only."]
135
+ children: t("spreadsheet.protectedSheet", "{name} is protected in the workbook, so Po keeps it read-only.", { name: sheet.name })
135
136
  })]
136
137
  }) : null,
137
138
  view.file.state === "consent" ? /* @__PURE__ */ jsxs(View, {
138
139
  style: styles.banner,
139
- children: [/* @__PURE__ */ jsxs(Text, {
140
+ children: [/* @__PURE__ */ jsx(Text, {
140
141
  style: [
141
142
  styles.note,
142
143
  styles.ask,
143
144
  styles.flex
144
145
  ],
145
- children: [
146
- "This workbook has parts Po's engine may simplify when it saves (",
147
- view.file.lossyParts.join(", "),
148
- "). Your changes stay here until you choose to save."
149
- ]
146
+ children: t("spreadsheet.lossy", "This workbook has parts Po's engine may simplify when it saves ({parts}). Your changes stay here until you choose to save.", { parts: view.file.lossyParts.join(", ") })
150
147
  }), /* @__PURE__ */ jsx(Button, {
151
148
  size: "sm",
152
149
  variant: "outline",
153
150
  disabled: busy,
154
151
  onPress: () => onAction?.("consent"),
155
- children: "Save to the file"
152
+ children: t("spreadsheet.save", "Save to the file")
156
153
  })]
157
154
  }) : null,
158
155
  message === void 0 ? null : /* @__PURE__ */ jsx(Text, {
@@ -197,7 +194,7 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
197
194
  const selected = selection?.row === row && selection.column === column;
198
195
  return /* @__PURE__ */ jsx(Pressable, {
199
196
  accessibilityRole: "button",
200
- accessibilityLabel: `${cellName(row, column)} ${cell?.text ?? "empty"}`,
197
+ accessibilityLabel: `${cellName(row, column)} ${cell?.text ?? t("spreadsheet.empty", "empty")}`,
201
198
  accessibilityState: { selected },
202
199
  onPress: () => onSelect?.({
203
200
  row,
@@ -240,7 +237,7 @@ function SpreadsheetCanvasViewNative({ view, state = "ready", message, selection
240
237
  style: styles.tab,
241
238
  children: [/* @__PURE__ */ jsx(LockIcon, {
242
239
  size: 14,
243
- accessibilityLabel: "protected"
240
+ accessibilityLabel: t("spreadsheet.protected", "protected")
244
241
  }), /* @__PURE__ */ jsx(Text, {
245
242
  style: styles.headerText,
246
243
  children: entry.name
@@ -388,6 +385,7 @@ const styles = StyleSheet.create((theme) => ({
388
385
  //#region src/extensions/workspaces/sessions/(frontend)/fill/_components/SpreadsheetCanvasPanel.native.tsx
389
386
  /** The phone's `.xlsx` canvas: the same session API and save rules as the web canvas, a cell at a time. */
390
387
  function SpreadsheetCanvasPanelNative({ sessionId, source }) {
388
+ const t = useT();
391
389
  const { path } = source;
392
390
  const [view, setView] = useState();
393
391
  const [failed, setFailed] = useState();
@@ -403,12 +401,16 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
403
401
  sheet: name
404
402
  } });
405
403
  if (!result.ok) {
406
- setFailed(result.error || "Po could not open this workbook.");
404
+ setFailed(result.error || t("spreadsheet.cannotOpen", "Po could not open this workbook."));
407
405
  return;
408
406
  }
409
407
  setFailed(void 0);
410
408
  setView(result.data);
411
- }, [path, sessionId]);
409
+ }, [
410
+ path,
411
+ sessionId,
412
+ t
413
+ ]);
412
414
  useEffect(() => {
413
415
  load("");
414
416
  }, [load]);
@@ -441,7 +443,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
441
443
  if (result.status === 409) await load(sheet);
442
444
  setMessage({
443
445
  tone: "red",
444
- text: result.status === 409 ? "The workbook changed while you were editing. Po reloaded it; try again." : result.status === 0 ? "Po lost the connection to the server. Your change was not made." : result.error || "Po could not make that change."
446
+ text: result.status === 409 ? t("spreadsheet.conflict", "The workbook changed while you were editing. Po reloaded it; try again.") : result.status === 0 ? t("spreadsheet.disconnected", "Po lost the connection to the server. Your change was not made.") : result.error || t("spreadsheet.cannotChange", "Po could not make that change.")
445
447
  });
446
448
  return false;
447
449
  }
@@ -466,7 +468,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
466
468
  setMessage(void 0);
467
469
  } else setMessage({
468
470
  tone: "red",
469
- text: result.error || "Po could not save the workbook."
471
+ text: result.error || t("spreadsheet.cannotSave", "Po could not save the workbook.")
470
472
  });
471
473
  } finally {
472
474
  setBusy(false);
@@ -474,7 +476,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
474
476
  return;
475
477
  }
476
478
  if (action === "undo") {
477
- await change([{ kind: "undo" }], "Undoing…");
479
+ await change([{ kind: "undo" }], t("spreadsheet.undoing", "Undoing…"));
478
480
  return;
479
481
  }
480
482
  if (action === "addSheet") {
@@ -484,7 +486,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
484
486
  await change([{
485
487
  kind: "addSheet",
486
488
  name: `Sheet${index}`
487
- }], "Adding a sheet…");
489
+ }], t("spreadsheet.addingSheet", "Adding a sheet…"));
488
490
  return;
489
491
  }
490
492
  if (selection === void 0) return;
@@ -498,7 +500,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
498
500
  await change([{
499
501
  kind,
500
502
  at: (rows ? selection.row : selection.column) + 1
501
- }], "Updating the sheet…");
503
+ }], t("spreadsheet.updating", "Updating the sheet…"));
502
504
  }
503
505
  return /* @__PURE__ */ jsx(SpreadsheetCanvasViewNative, {
504
506
  view,
@@ -527,7 +529,7 @@ function SpreadsheetCanvasPanelNative({ sessionId, source }) {
527
529
  kind: "setCell",
528
530
  cell,
529
531
  input: draft
530
- }], `Saving ${cell}…`).then((saved) => {
532
+ }], t("spreadsheet.savingCell", "Saving {cell}…", { cell })).then((saved) => {
531
533
  if (saved) setDraft(void 0);
532
534
  });
533
535
  },