@humandialog/forms.svelte 1.8.7 → 1.8.8

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.
@@ -74,9 +74,9 @@ export let onLinkClick = void 0;
74
74
  export let c = "";
75
75
  export let chat = void 0;
76
76
  export let readOnly = false;
77
- export let extraFrontPaletteCommands = [];
78
- export let extraBackPaletteCommands = [];
79
- export let extraInsertPaletteCommands = [];
77
+ export let extraFrontPaletteCommands = void 0;
78
+ export let extraBackPaletteCommands = void 0;
79
+ export let extraInsertPaletteCommands = void 0;
80
80
  let onFinishEditing = void 0;
81
81
  export function run(onStop = void 0) {
82
82
  onFinishEditing = onStop;
@@ -146,8 +146,16 @@ export function getStylesOperations(tbr = "A") {
146
146
  }
147
147
  export function getInsertOperations(tbr = "A") {
148
148
  let operations = [];
149
- if (extraInsertPaletteCommands && extraInsertPaletteCommands.length > 0) {
150
- extraInsertPaletteCommands.forEach((exc) => {
149
+ let additionalCommands = [];
150
+ if (extraInsertPaletteCommands) {
151
+ if (typeof extraInsertPaletteCommands === "function") {
152
+ additionalCommands = extraInsertPaletteCommands();
153
+ } else if (Array.isArray(extraInsertPaletteCommands) && extraInsertPaletteCommands.length > 0) {
154
+ additionalCommands = extraInsertPaletteCommands;
155
+ }
156
+ }
157
+ if (additionalCommands && additionalCommands.length > 0) {
158
+ additionalCommands.forEach((exc) => {
151
159
  operations = [...operations, exc];
152
160
  });
153
161
  }
@@ -1048,7 +1056,7 @@ const paletteMarksCommands = () => [
1048
1056
  { caption: i18n({ en: "Strikethrough", es: "Tachado", pl: "Przekre\u015Blenie" }), description: "Marks text as strikethrough", tags: "strike", mricon: "strikethrough", on_choice: makeStrikethrough, is_active: () => editor?.isActive("strike") }
1049
1057
  ];
1050
1058
  const paletteStylesCommands = () => [
1051
- { caption: i18n({ en: "Heading 1", es: "T\xEDtulo 1", pl: "Nag\u0142\xF3wek 1#" }), description: "Description heading", tags: "h1,head", mricon: "heading-1", on_choice: (range) => {
1059
+ { caption: i18n({ en: "Heading 1", es: "T\xEDtulo 1", pl: "Nag\u0142\xF3wek 1" }), description: "Description heading", tags: "h1,head", mricon: "heading-1", on_choice: (range) => {
1052
1060
  if (range)
1053
1061
  editor.chain().focus().deleteRange(range).setHeading({ level: 1 }).run();
1054
1062
  else
@@ -1167,8 +1175,16 @@ function makeStrikethrough(range) {
1167
1175
  }
1168
1176
  function getPaletteCommands() {
1169
1177
  let commands = [];
1170
- if (extraFrontPaletteCommands && extraFrontPaletteCommands.length > 0) {
1171
- extraFrontPaletteCommands.forEach((exc) => {
1178
+ let additionalCommands = [];
1179
+ if (extraFrontPaletteCommands) {
1180
+ if (typeof extraFrontPaletteCommands === "function") {
1181
+ additionalCommands = extraFrontPaletteCommands();
1182
+ } else if (Array.isArray(extraFrontPaletteCommands) && extraFrontPaletteCommands.length > 0) {
1183
+ additionalCommands = extraFrontPaletteCommands;
1184
+ }
1185
+ }
1186
+ if (additionalCommands && additionalCommands.length > 0) {
1187
+ additionalCommands.forEach((exc) => {
1172
1188
  commands.push({
1173
1189
  caption: exc.caption,
1174
1190
  description: exc.description,
@@ -1198,8 +1214,16 @@ function getPaletteCommands() {
1198
1214
  commands = [...commands, { caption: i18n({ en: "Text", es: "Texto", pl: "Tekst" }), separator: true }];
1199
1215
  commands = [...commands, ...paletteMarksCommands()];
1200
1216
  commands = [...commands, { caption: i18n({ en: "Insert", es: "Insertar", pl: "Wstaw" }), separator: true }];
1201
- if (extraInsertPaletteCommands && extraInsertPaletteCommands.length > 0) {
1202
- extraInsertPaletteCommands.forEach((exc) => {
1217
+ additionalCommands = [];
1218
+ if (extraInsertPaletteCommands) {
1219
+ if (typeof extraInsertPaletteCommands === "function") {
1220
+ additionalCommands = extraInsertPaletteCommands();
1221
+ } else if (Array.isArray(extraInsertPaletteCommands) && extraInsertPaletteCommands.length > 0) {
1222
+ additionalCommands = extraInsertPaletteCommands;
1223
+ }
1224
+ }
1225
+ if (additionalCommands && additionalCommands.length > 0) {
1226
+ additionalCommands.forEach((exc) => {
1203
1227
  commands.push({
1204
1228
  caption: exc.caption,
1205
1229
  description: exc.description,
@@ -1224,9 +1248,17 @@ function getPaletteCommands() {
1224
1248
  });
1225
1249
  }
1226
1250
  commands = [...commands, ...paletteInsertCommands()];
1227
- if (extraBackPaletteCommands && extraBackPaletteCommands.length > 0) {
1251
+ additionalCommands = [];
1252
+ if (extraBackPaletteCommands) {
1253
+ if (typeof extraBackPaletteCommands === "function") {
1254
+ additionalCommands = extraBackPaletteCommands();
1255
+ } else if (Array.isArray(extraBackPaletteCommands) && extraBackPaletteCommands.length > 0) {
1256
+ additionalCommands = extraBackPaletteCommands;
1257
+ }
1258
+ }
1259
+ if (additionalCommands && additionalCommands.length > 0) {
1228
1260
  commands.push({ separator: true });
1229
- extraBackPaletteCommands.forEach((exc) => {
1261
+ additionalCommands.forEach((exc) => {
1230
1262
  commands.push({
1231
1263
  caption: exc.caption,
1232
1264
  description: exc.description,
@@ -18,9 +18,9 @@ declare const __propDef: {
18
18
  c?: string | undefined;
19
19
  chat?: object | undefined;
20
20
  readOnly?: boolean | undefined;
21
- extraFrontPaletteCommands?: any[] | undefined;
22
- extraBackPaletteCommands?: any[] | undefined;
23
- extraInsertPaletteCommands?: any[] | undefined;
21
+ extraFrontPaletteCommands?: Array<object> | Function | undefined;
22
+ extraBackPaletteCommands?: Array<object> | Function | undefined;
23
+ extraInsertPaletteCommands?: Array<object> | Function | undefined;
24
24
  run?: ((onStop?: undefined) => void) | undefined;
25
25
  getFormattingOperations?: ((withCaptions?: boolean) => any[]) | undefined;
26
26
  getMarksOperations?: ((tbr?: string) => {
@@ -4,7 +4,7 @@ import { parseWidthDirective, clearActiveItem, getPrev, getNext, remove, insertA
4
4
  import { contextItemsStore, contextTypesStore, data_tick_store } from "../../stores";
5
5
  import KanbanColumn from "./internal/kanban.column.svelte";
6
6
  import { informModification, pushChanges } from "../../updates";
7
- import { Editable } from "../..";
7
+ import { Editable, focusEditable } from "../..";
8
8
  export let self = null;
9
9
  export let title = "";
10
10
  export let summary = "";
@@ -144,6 +144,12 @@ export function edit(item, field) {
144
144
  card.editProperty(field);
145
145
  }
146
146
  }
147
+ export function editTitle() {
148
+ focusEditable(title);
149
+ }
150
+ export function editSummary() {
151
+ focusEditable(summary);
152
+ }
147
153
  let columns = [];
148
154
  export function scrollViewToCard(item) {
149
155
  columns.forEach((c2) => {
@@ -15,6 +15,8 @@ declare const __propDef: {
15
15
  reload?: ((data: object | object[], selectElement?: number) => Promise<void>) | undefined;
16
16
  getColumnIdx?: ((item: any) => number) | undefined;
17
17
  edit?: ((item: object, field: string) => void) | undefined;
18
+ editTitle?: (() => void) | undefined;
19
+ editSummary?: (() => void) | undefined;
18
20
  scrollViewToCard?: ((item: any) => void) | undefined;
19
21
  moveUp?: ((item: object) => void) | undefined;
20
22
  moveDown?: ((item: object) => void) | undefined;
@@ -54,6 +56,8 @@ export default class Kanban extends SvelteComponentTyped<KanbanProps, KanbanEven
54
56
  get reload(): (data: object | object[], selectElement?: number) => Promise<void>;
55
57
  get getColumnIdx(): (item: any) => number;
56
58
  get edit(): (item: object, field: string) => void;
59
+ get editTitle(): () => void;
60
+ get editSummary(): () => void;
57
61
  get scrollViewToCard(): (item: any) => void;
58
62
  get moveUp(): (item: object) => void;
59
63
  get moveDown(): (item: object) => void;
@@ -357,8 +357,7 @@ async function onDownloadFile(e) {
357
357
  bg-stone-200 dark:bg-stone-700
358
358
  outline outline-8
359
359
  outline-stone-200 dark:outline-stone-700
360
- ring-1 ring-offset-8
361
- ring-stone-300 dark:ring-stone-700
360
+
362
361
  "
363
362
 
364
363
  bind:this={rootElement}
@@ -376,7 +375,7 @@ async function onDownloadFile(e) {
376
375
  href={element_href}
377
376
  on:click={onDownloadFile}>
378
377
 
379
- <h4 class="-indent-8">
378
+ <h4 class="-indent-8 mt-0">
380
379
  <div class="inline-block w-4 h-4 ml-0 mr-4 align-baseline
381
380
  text-stone-700 dark:text-stone-400 ">
382
381
  <Ricon icon={isDownloading ? 'loader-circle' : element_icon} />
@@ -391,7 +390,7 @@ async function onDownloadFile(e) {
391
390
  <a class="sm:hover:cursor-pointer"
392
391
  href={element_href} use:link>
393
392
 
394
- <h4 class="-indent-8 ">
393
+ <h4 class="-indent-8 mt-0">
395
394
  <div class="inline-block w-4 h-4 ml-0 mr-4 align-baseline
396
395
  text-stone-700 dark:text-stone-400 ">
397
396
  <Ricon icon={element_icon} />
@@ -407,7 +406,7 @@ async function onDownloadFile(e) {
407
406
  href="/#"
408
407
  on:click|preventDefault={() => element_open_handler(item)}>
409
408
 
410
- <h4 class="-indent-8">
409
+ <h4 class="-indent-8 mt-0">
411
410
  <div class="inline-block w-4 h-4 ml-0 mr-4 align-baseline
412
411
  text-stone-700 dark:text-stone-400 ">
413
412
  <Ricon icon={element_icon} />
@@ -91,6 +91,10 @@
91
91
 
92
92
  import LoaderCircle from './ricons/loader-circle.svelte'
93
93
  import Check from './ricons/check.svelte'
94
+ import Star from './ricons/star.svelte'
95
+ import StarOff from './ricons/star-off.svelte'
96
+ import Heart from './ricons/heart.svelte'
97
+ import HeartOff from './ricons/heart-off.svelte'
94
98
 
95
99
  let ricons_box = {
96
100
  "arrow-up": ArrowUp,
@@ -173,7 +177,11 @@
173
177
  'minus': Minus,
174
178
 
175
179
  'loader-circle': LoaderCircle,
176
- 'check': Check
180
+ 'check': Check,
181
+ 'star': Star,
182
+ 'star-off': StarOff,
183
+ 'heart': Heart,
184
+ 'heart-off': HeartOff
177
185
  }
178
186
 
179
187
  let width = 24;
@@ -0,0 +1,8 @@
1
+ <script>
2
+ export let w = 24;
3
+ export let h = 24;
4
+ export let s = 1;
5
+ </script>
6
+
7
+
8
+ <svg xmlns="http://www.w3.org/2000/svg" width={w} height={h} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width={s} stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-heart-off-icon lucide-heart-off"><path d="M10.5 4.893a5.5 5.5 0 0 1 1.091.931.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 1.872-1.002 3.356-2.187 4.655"/><path d="m16.967 16.967-3.459 3.346a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5a5.5 5.5 0 0 1 2.747-4.761"/><path d="m2 2 20 20"/></svg>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} HeartOffProps */
2
+ /** @typedef {typeof __propDef.events} HeartOffEvents */
3
+ /** @typedef {typeof __propDef.slots} HeartOffSlots */
4
+ export default class HeartOff extends SvelteComponentTyped<{
5
+ w?: number | undefined;
6
+ s?: number | undefined;
7
+ h?: number | undefined;
8
+ }, {
9
+ [evt: string]: CustomEvent<any>;
10
+ }, {}> {
11
+ }
12
+ export type HeartOffProps = typeof __propDef.props;
13
+ export type HeartOffEvents = typeof __propDef.events;
14
+ export type HeartOffSlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ w?: number | undefined;
19
+ s?: number | undefined;
20
+ h?: number | undefined;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {};
26
+ };
27
+ export {};
@@ -0,0 +1,8 @@
1
+ <script>
2
+ export let w = 24;
3
+ export let h = 24;
4
+ export let s = 1;
5
+ </script>
6
+
7
+
8
+ <svg xmlns="http://www.w3.org/2000/svg" width={w} height={h} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width={s} stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-heart-icon lucide-heart"><path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"/></svg>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} HeartProps */
2
+ /** @typedef {typeof __propDef.events} HeartEvents */
3
+ /** @typedef {typeof __propDef.slots} HeartSlots */
4
+ export default class Heart extends SvelteComponentTyped<{
5
+ w?: number | undefined;
6
+ s?: number | undefined;
7
+ h?: number | undefined;
8
+ }, {
9
+ [evt: string]: CustomEvent<any>;
10
+ }, {}> {
11
+ }
12
+ export type HeartProps = typeof __propDef.props;
13
+ export type HeartEvents = typeof __propDef.events;
14
+ export type HeartSlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ w?: number | undefined;
19
+ s?: number | undefined;
20
+ h?: number | undefined;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {};
26
+ };
27
+ export {};
@@ -0,0 +1,8 @@
1
+ <script>
2
+ export let w = 24;
3
+ export let h = 24;
4
+ export let s = 1;
5
+ </script>
6
+
7
+
8
+ <svg xmlns="http://www.w3.org/2000/svg" width={w} height={h} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width={s} stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star-off-icon lucide-star-off"><path d="m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152"/><path d="m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099"/><path d="m2 2 20 20"/></svg>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} StarOffProps */
2
+ /** @typedef {typeof __propDef.events} StarOffEvents */
3
+ /** @typedef {typeof __propDef.slots} StarOffSlots */
4
+ export default class StarOff extends SvelteComponentTyped<{
5
+ w?: number | undefined;
6
+ s?: number | undefined;
7
+ h?: number | undefined;
8
+ }, {
9
+ [evt: string]: CustomEvent<any>;
10
+ }, {}> {
11
+ }
12
+ export type StarOffProps = typeof __propDef.props;
13
+ export type StarOffEvents = typeof __propDef.events;
14
+ export type StarOffSlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ w?: number | undefined;
19
+ s?: number | undefined;
20
+ h?: number | undefined;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {};
26
+ };
27
+ export {};
@@ -0,0 +1,8 @@
1
+ <script>
2
+ export let w = 24;
3
+ export let h = 24;
4
+ export let s = 1;
5
+ </script>
6
+
7
+
8
+ <svg xmlns="http://www.w3.org/2000/svg" width={w} height={h} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width={s} stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star-icon lucide-star"><path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/></svg>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} StarProps */
2
+ /** @typedef {typeof __propDef.events} StarEvents */
3
+ /** @typedef {typeof __propDef.slots} StarSlots */
4
+ export default class Star extends SvelteComponentTyped<{
5
+ w?: number | undefined;
6
+ s?: number | undefined;
7
+ h?: number | undefined;
8
+ }, {
9
+ [evt: string]: CustomEvent<any>;
10
+ }, {}> {
11
+ }
12
+ export type StarProps = typeof __propDef.props;
13
+ export type StarEvents = typeof __propDef.events;
14
+ export type StarSlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ w?: number | undefined;
19
+ s?: number | undefined;
20
+ h?: number | undefined;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {};
26
+ };
27
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "1.8.7",
3
+ "version": "1.8.8",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",
@@ -196,6 +196,8 @@
196
196
  "./components/ricons/heading-3.svelte": "./components/ricons/heading-3.svelte",
197
197
  "./components/ricons/heading-4.svelte": "./components/ricons/heading-4.svelte",
198
198
  "./components/ricons/heading-5.svelte": "./components/ricons/heading-5.svelte",
199
+ "./components/ricons/heart-off.svelte": "./components/ricons/heart-off.svelte",
200
+ "./components/ricons/heart.svelte": "./components/ricons/heart.svelte",
199
201
  "./components/ricons/image.svelte": "./components/ricons/image.svelte",
200
202
  "./components/ricons/italic.svelte": "./components/ricons/italic.svelte",
201
203
  "./components/ricons/languages.svelte": "./components/ricons/languages.svelte",
@@ -220,6 +222,8 @@
220
222
  "./components/ricons/square-check-big.svelte": "./components/ricons/square-check-big.svelte",
221
223
  "./components/ricons/square-pen.svelte": "./components/ricons/square-pen.svelte",
222
224
  "./components/ricons/square.svelte": "./components/ricons/square.svelte",
225
+ "./components/ricons/star-off.svelte": "./components/ricons/star-off.svelte",
226
+ "./components/ricons/star.svelte": "./components/ricons/star.svelte",
223
227
  "./components/ricons/strikethrough.svelte": "./components/ricons/strikethrough.svelte",
224
228
  "./components/ricons/sun-moon.svelte": "./components/ricons/sun-moon.svelte",
225
229
  "./components/ricons/table.svelte": "./components/ricons/table.svelte",