@colixsystems/widget-sdk 0.273.0 → 0.274.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
@@ -86,7 +86,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
86
86
 
87
87
  ## Status
88
88
 
89
- `v0.273.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**.
89
+ `v0.274.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**.
90
+
91
+ ### What's new in 0.274.0 (contract 1.224.0)
92
+
93
+ **The shared widget strings ship in Swedish.** Every entry in `CONTRACT.sharedTranslationKeys` now carries a hand-written `sv` value beside `en` (`cancel` is `{ en: "Cancel", sv: "Avbryt" }`), so a Swedish workspace gets the right word instead of a machine translation of a lone word. Translation seeding also matches a regional language to its primary one: a workspace language `sv-SE` takes the `sv` text a widget's `manifest.translations` ships, unless the widget ships `sv-SE` itself.
90
94
 
91
95
  ### What's new in 0.273.0 (contract 1.223.0)
92
96
 
@@ -3632,7 +3636,7 @@ export default function OpenTasks({ tableId, titleField, statusField }) {
3632
3636
  | `filter` | Keeps the rows that match. A map `{ column: "op:value" }` (an array of expressions puts a range on one column), or an array `[{ column, operator, value }]`. |
3633
3637
  | `filterMode` | `"and"` (the default) keeps rows matching every condition; `"or"` keeps rows matching any. |
3634
3638
  | `q` | Free-text search: a case-insensitive substring match across every text column of the table (encrypted columns excepted). |
3635
- | `sort` | `{ field, dir }` with `dir` `"asc"` or `"desc"`, or the string `"field:desc"`. One column; `created_at` and `updated_at` work too. |
3639
+ | `sort` | `{ field, dir }` with `dir` `"asc"` or `"desc"`, or the string `"field:desc"`. One column; `created_at` and `updated_at` work too. Newest first is `{ field: "created_at", dir: "desc" }`. `"-field"` or an unknown column is refused: `data` stays empty and `error` names the sortable columns. |
3636
3640
  | `limit` | Rows per page: 50 when left out, at most 1000. |
3637
3641
  | `offset` | Rows to skip, for the next page. |
3638
3642
  | `includeCapabilities` | `true` stamps each row with `_capabilities`, what the signed-in user may do to it. |
@@ -3665,12 +3669,13 @@ export default function ContactList({ tableId }) {
3665
3669
  limit: PAGE,
3666
3670
  offset: page * PAGE,
3667
3671
  }));
3668
- const { data, total, loading } = useDatastoreQuery(tableId, query);
3672
+ const { data, total, loading, error } = useDatastoreQuery(tableId, query);
3669
3673
  const pick = (next) => { setStatus(next); setPage(0); };
3670
3674
  return (
3671
3675
  <View>
3672
3676
  <TextInput value={draft} onChangeText={setDraft} placeholder="Search" />
3673
3677
  <Pressable onPress={() => pick(status === "Won" ? "" : "Won")}><Text>Won</Text></Pressable>
3678
+ {error ? <Text>{error.message}</Text> : null}
3674
3679
  {loading ? <Text>Loading…</Text> : data.map((row) => <Text key={row.id}>{row.name}</Text>)}
3675
3680
  <Text>{total ?? 0} contacts</Text>
3676
3681
  {(page + 1) * PAGE < (total ?? 0) ? (
package/dist/contract.cjs CHANGED
@@ -5127,32 +5127,33 @@ function sharedTranslationKey(key) {
5127
5127
  return `${SHARED_TRANSLATION_PREFIX}${key}`;
5128
5128
  }
5129
5129
 
5130
- // The predefined set. Map of bare key -> { en } (English default only; the
5131
- // tenant adds target-language values once in the Translations admin and every
5132
- // widget inherits them). Adding/removing a key is a CONTRACT change (it grows
5133
- // the dictionary every tenant gets), so the list lives with the contract and
5134
- // the seeder reads it from here — never a second copy.
5130
+ // The predefined set. Map of bare key -> { en, sv }. Swedish is shipped by
5131
+ // hand because a lone word machine-translates to the wrong sense ("Cancel" ->
5132
+ // "Avboka"); other languages are translated in the Translations admin and
5133
+ // every widget inherits them. Adding/removing a key is a CONTRACT change (it
5134
+ // grows the dictionary every tenant gets), so the list lives with the contract
5135
+ // and the seeder reads it from here — never a second copy.
5135
5136
  const SHARED_TRANSLATION_KEYS = Object.freeze({
5136
- submit: { en: "Submit" },
5137
- cancel: { en: "Cancel" },
5138
- save: { en: "Save" },
5139
- delete: { en: "Delete" },
5140
- edit: { en: "Edit" },
5141
- close: { en: "Close" },
5142
- confirm: { en: "Confirm" },
5143
- back: { en: "Back" },
5144
- next: { en: "Next" },
5145
- previous: { en: "Previous" },
5146
- yes: { en: "Yes" },
5147
- no: { en: "No" },
5148
- ok: { en: "OK" },
5149
- loading: { en: "Loading…" },
5150
- search: { en: "Search" },
5151
- no_results: { en: "No results" },
5152
- required: { en: "Required" },
5153
- retry: { en: "Retry" },
5154
- add: { en: "Add" },
5155
- remove: { en: "Remove" },
5137
+ submit: { en: "Submit", sv: "Skicka" },
5138
+ cancel: { en: "Cancel", sv: "Avbryt" },
5139
+ save: { en: "Save", sv: "Spara" },
5140
+ delete: { en: "Delete", sv: "Ta bort" },
5141
+ edit: { en: "Edit", sv: "Redigera" },
5142
+ close: { en: "Close", sv: "Stäng" },
5143
+ confirm: { en: "Confirm", sv: "Bekräfta" },
5144
+ back: { en: "Back", sv: "Tillbaka" },
5145
+ next: { en: "Next", sv: "Nästa" },
5146
+ previous: { en: "Previous", sv: "Föregående" },
5147
+ yes: { en: "Yes", sv: "Ja" },
5148
+ no: { en: "No", sv: "Nej" },
5149
+ ok: { en: "OK", sv: "OK" },
5150
+ loading: { en: "Loading…", sv: "Laddar…" },
5151
+ search: { en: "Search", sv: "Sök" },
5152
+ no_results: { en: "No results", sv: "Inga resultat" },
5153
+ required: { en: "Required", sv: "Obligatoriskt" },
5154
+ retry: { en: "Retry", sv: "Försök igen" },
5155
+ add: { en: "Add", sv: "Lägg till" },
5156
+ remove: { en: "Remove", sv: "Ta bort" },
5156
5157
  });
5157
5158
 
5158
5159
  // True when `key` is one of the predefined shared keys — the discriminator
@@ -6568,7 +6569,9 @@ const CONTRACT = deepFreeze({
6568
6569
  // 1.223.0: stricter (sc-12906) — `scopeMintPatterns`; a widget that calls
6569
6570
  // the scope-header mint or sets `X-Widget-Scopes` is refused
6570
6571
  // (`no-scope-header-mint`).
6571
- version: "1.223.0",
6572
+ // 1.224.0: additive (sc-14501) — every `sharedTranslationKeys` entry
6573
+ // ships a hand-written `sv` value beside `en`.
6574
+ version: "1.224.0",
6572
6575
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6573
6576
  hooks: HOOKS,
6574
6577
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -5124,32 +5124,33 @@ function sharedTranslationKey(key) {
5124
5124
  return `${SHARED_TRANSLATION_PREFIX}${key}`;
5125
5125
  }
5126
5126
 
5127
- // The predefined set. Map of bare key -> { en } (English default only; the
5128
- // tenant adds target-language values once in the Translations admin and every
5129
- // widget inherits them). Adding/removing a key is a CONTRACT change (it grows
5130
- // the dictionary every tenant gets), so the list lives with the contract and
5131
- // the seeder reads it from here — never a second copy.
5127
+ // The predefined set. Map of bare key -> { en, sv }. Swedish is shipped by
5128
+ // hand because a lone word machine-translates to the wrong sense ("Cancel" ->
5129
+ // "Avboka"); other languages are translated in the Translations admin and
5130
+ // every widget inherits them. Adding/removing a key is a CONTRACT change (it
5131
+ // grows the dictionary every tenant gets), so the list lives with the contract
5132
+ // and the seeder reads it from here — never a second copy.
5132
5133
  const SHARED_TRANSLATION_KEYS = Object.freeze({
5133
- submit: { en: "Submit" },
5134
- cancel: { en: "Cancel" },
5135
- save: { en: "Save" },
5136
- delete: { en: "Delete" },
5137
- edit: { en: "Edit" },
5138
- close: { en: "Close" },
5139
- confirm: { en: "Confirm" },
5140
- back: { en: "Back" },
5141
- next: { en: "Next" },
5142
- previous: { en: "Previous" },
5143
- yes: { en: "Yes" },
5144
- no: { en: "No" },
5145
- ok: { en: "OK" },
5146
- loading: { en: "Loading…" },
5147
- search: { en: "Search" },
5148
- no_results: { en: "No results" },
5149
- required: { en: "Required" },
5150
- retry: { en: "Retry" },
5151
- add: { en: "Add" },
5152
- remove: { en: "Remove" },
5134
+ submit: { en: "Submit", sv: "Skicka" },
5135
+ cancel: { en: "Cancel", sv: "Avbryt" },
5136
+ save: { en: "Save", sv: "Spara" },
5137
+ delete: { en: "Delete", sv: "Ta bort" },
5138
+ edit: { en: "Edit", sv: "Redigera" },
5139
+ close: { en: "Close", sv: "Stäng" },
5140
+ confirm: { en: "Confirm", sv: "Bekräfta" },
5141
+ back: { en: "Back", sv: "Tillbaka" },
5142
+ next: { en: "Next", sv: "Nästa" },
5143
+ previous: { en: "Previous", sv: "Föregående" },
5144
+ yes: { en: "Yes", sv: "Ja" },
5145
+ no: { en: "No", sv: "Nej" },
5146
+ ok: { en: "OK", sv: "OK" },
5147
+ loading: { en: "Loading…", sv: "Laddar…" },
5148
+ search: { en: "Search", sv: "Sök" },
5149
+ no_results: { en: "No results", sv: "Inga resultat" },
5150
+ required: { en: "Required", sv: "Obligatoriskt" },
5151
+ retry: { en: "Retry", sv: "Försök igen" },
5152
+ add: { en: "Add", sv: "Lägg till" },
5153
+ remove: { en: "Remove", sv: "Ta bort" },
5153
5154
  });
5154
5155
 
5155
5156
  // True when `key` is one of the predefined shared keys — the discriminator
@@ -6565,7 +6566,9 @@ const CONTRACT = deepFreeze({
6565
6566
  // 1.223.0: stricter (sc-12906) — `scopeMintPatterns`; a widget that calls
6566
6567
  // the scope-header mint or sets `X-Widget-Scopes` is refused
6567
6568
  // (`no-scope-header-mint`).
6568
- version: "1.223.0",
6569
+ // 1.224.0: additive (sc-14501) — every `sharedTranslationKeys` entry
6570
+ // ships a hand-written `sv` value beside `en`.
6571
+ version: "1.224.0",
6569
6572
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6570
6573
  hooks: HOOKS,
6571
6574
  primitives: PRIMITIVES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.273.0",
3
+ "version": "0.274.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "homepage": "https://github.com/Colix-AB/AppStudio",
6
6
  "type": "module",
package/src/contract.js CHANGED
@@ -5124,32 +5124,33 @@ function sharedTranslationKey(key) {
5124
5124
  return `${SHARED_TRANSLATION_PREFIX}${key}`;
5125
5125
  }
5126
5126
 
5127
- // The predefined set. Map of bare key -> { en } (English default only; the
5128
- // tenant adds target-language values once in the Translations admin and every
5129
- // widget inherits them). Adding/removing a key is a CONTRACT change (it grows
5130
- // the dictionary every tenant gets), so the list lives with the contract and
5131
- // the seeder reads it from here — never a second copy.
5127
+ // The predefined set. Map of bare key -> { en, sv }. Swedish is shipped by
5128
+ // hand because a lone word machine-translates to the wrong sense ("Cancel" ->
5129
+ // "Avboka"); other languages are translated in the Translations admin and
5130
+ // every widget inherits them. Adding/removing a key is a CONTRACT change (it
5131
+ // grows the dictionary every tenant gets), so the list lives with the contract
5132
+ // and the seeder reads it from here — never a second copy.
5132
5133
  const SHARED_TRANSLATION_KEYS = Object.freeze({
5133
- submit: { en: "Submit" },
5134
- cancel: { en: "Cancel" },
5135
- save: { en: "Save" },
5136
- delete: { en: "Delete" },
5137
- edit: { en: "Edit" },
5138
- close: { en: "Close" },
5139
- confirm: { en: "Confirm" },
5140
- back: { en: "Back" },
5141
- next: { en: "Next" },
5142
- previous: { en: "Previous" },
5143
- yes: { en: "Yes" },
5144
- no: { en: "No" },
5145
- ok: { en: "OK" },
5146
- loading: { en: "Loading…" },
5147
- search: { en: "Search" },
5148
- no_results: { en: "No results" },
5149
- required: { en: "Required" },
5150
- retry: { en: "Retry" },
5151
- add: { en: "Add" },
5152
- remove: { en: "Remove" },
5134
+ submit: { en: "Submit", sv: "Skicka" },
5135
+ cancel: { en: "Cancel", sv: "Avbryt" },
5136
+ save: { en: "Save", sv: "Spara" },
5137
+ delete: { en: "Delete", sv: "Ta bort" },
5138
+ edit: { en: "Edit", sv: "Redigera" },
5139
+ close: { en: "Close", sv: "Stäng" },
5140
+ confirm: { en: "Confirm", sv: "Bekräfta" },
5141
+ back: { en: "Back", sv: "Tillbaka" },
5142
+ next: { en: "Next", sv: "Nästa" },
5143
+ previous: { en: "Previous", sv: "Föregående" },
5144
+ yes: { en: "Yes", sv: "Ja" },
5145
+ no: { en: "No", sv: "Nej" },
5146
+ ok: { en: "OK", sv: "OK" },
5147
+ loading: { en: "Loading…", sv: "Laddar…" },
5148
+ search: { en: "Search", sv: "Sök" },
5149
+ no_results: { en: "No results", sv: "Inga resultat" },
5150
+ required: { en: "Required", sv: "Obligatoriskt" },
5151
+ retry: { en: "Retry", sv: "Försök igen" },
5152
+ add: { en: "Add", sv: "Lägg till" },
5153
+ remove: { en: "Remove", sv: "Ta bort" },
5153
5154
  });
5154
5155
 
5155
5156
  // True when `key` is one of the predefined shared keys — the discriminator
@@ -6565,7 +6566,9 @@ const CONTRACT = deepFreeze({
6565
6566
  // 1.223.0: stricter (sc-12906) — `scopeMintPatterns`; a widget that calls
6566
6567
  // the scope-header mint or sets `X-Widget-Scopes` is refused
6567
6568
  // (`no-scope-header-mint`).
6568
- version: "1.223.0",
6569
+ // 1.224.0: additive (sc-14501) — every `sharedTranslationKeys` entry
6570
+ // ships a hand-written `sv` value beside `en`.
6571
+ version: "1.224.0",
6569
6572
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6570
6573
  hooks: HOOKS,
6571
6574
  primitives: PRIMITIVES,