@humandialog/forms.svelte 1.6.2 → 1.6.4
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/components/document/editor.svelte +6 -6
- package/components/document/internal/palette.svelte +1 -3
- package/components/list/internal/list.element.svelte +5 -0
- package/components/sidebar/sidebar.group.svelte +29 -12
- package/components/sidebar/sidebar.group.svelte.d.ts +2 -0
- package/kicks.js +1 -1
- package/package.json +2 -1
- package/vertical.toolbar.svelte +56 -3
|
@@ -1094,15 +1094,15 @@ const paletteInsertCommands = () => [
|
|
|
1094
1094
|
];
|
|
1095
1095
|
const paletteCommands = [
|
|
1096
1096
|
{
|
|
1097
|
-
caption: i18n({ en: "
|
|
1097
|
+
caption: i18n({ en: "Styles", es: "Estilos", pl: "Style" }),
|
|
1098
1098
|
separator: true
|
|
1099
1099
|
},
|
|
1100
|
-
...
|
|
1100
|
+
...paletteStylesCommands(),
|
|
1101
1101
|
{
|
|
1102
|
-
caption: i18n({ en: "
|
|
1102
|
+
caption: i18n({ en: "Text", es: "Texto", pl: "Tekst" }),
|
|
1103
1103
|
separator: true
|
|
1104
1104
|
},
|
|
1105
|
-
...
|
|
1105
|
+
...paletteMarksCommands(),
|
|
1106
1106
|
{
|
|
1107
1107
|
caption: i18n({ en: "Insert", es: "Insertar", pl: "Wstaw" }),
|
|
1108
1108
|
separator: true
|
|
@@ -1162,10 +1162,10 @@ function getPaletteCommands() {
|
|
|
1162
1162
|
});
|
|
1163
1163
|
commands.push({ separator: true });
|
|
1164
1164
|
}
|
|
1165
|
-
commands = [...commands, { caption: i18n({ en: "Text", es: "Texto", pl: "Tekst" }), separator: true }];
|
|
1166
|
-
commands = [...commands, ...paletteMarksCommands()];
|
|
1167
1165
|
commands = [...commands, { caption: i18n({ en: "Styles", es: "Estilos", pl: "Style" }), separator: true }];
|
|
1168
1166
|
commands = [...commands, ...paletteStylesCommands()];
|
|
1167
|
+
commands = [...commands, { caption: i18n({ en: "Text", es: "Texto", pl: "Tekst" }), separator: true }];
|
|
1168
|
+
commands = [...commands, ...paletteMarksCommands()];
|
|
1169
1169
|
commands = [...commands, { caption: i18n({ en: "Insert", es: "Insertar", pl: "Wstaw" }), separator: true }];
|
|
1170
1170
|
if (extraInsertPaletteCommands && extraInsertPaletteCommands.length > 0) {
|
|
1171
1171
|
extraInsertPaletteCommands.forEach((exc) => {
|
|
@@ -29,7 +29,6 @@ export function showAsToolbox(rect) {
|
|
|
29
29
|
toolboxY = rect.bottom + margin;
|
|
30
30
|
toolboxY += window.scrollY;
|
|
31
31
|
css_style = `left:${toolboxX}px; top:${toolboxY}px;`;
|
|
32
|
-
console.log("toolbox: ", css_style);
|
|
33
32
|
dispatch("palette_shown");
|
|
34
33
|
}
|
|
35
34
|
let paletteElement;
|
|
@@ -62,7 +61,6 @@ export function show(x, y, up = false) {
|
|
|
62
61
|
const rect = paletteElement.getBoundingClientRect();
|
|
63
62
|
closeButtonPos = `right: ${15}px; top: calc(${rect.y}px - 1.75rem)`;
|
|
64
63
|
}, 0);
|
|
65
|
-
console.trace();
|
|
66
64
|
}
|
|
67
65
|
export function show_fullscreen(_width_px, _height_px) {
|
|
68
66
|
isToolbox = false;
|
|
@@ -319,7 +317,7 @@ function isRowActive(cmd) {
|
|
|
319
317
|
style={css_style} >
|
|
320
318
|
|
|
321
319
|
{#if filtered_commands && filtered_commands.length}
|
|
322
|
-
{#each filtered_commands as cmd, idx
|
|
320
|
+
{#each filtered_commands as cmd, idx }
|
|
323
321
|
{#if cmd.separator}
|
|
324
322
|
{#if idx>0 && idx<filtered_commands.length-1} <!-- not first or last place -->
|
|
325
323
|
<hr class="mx-4 my-1 border-stone-300 dark:border-stone-700"/>
|
|
@@ -165,10 +165,15 @@ function getHRef() {
|
|
|
165
165
|
return "";
|
|
166
166
|
}
|
|
167
167
|
function activate_row(e, item2) {
|
|
168
|
+
const openable = !!definition.title_href || !!definition.title_href_func;
|
|
168
169
|
if (toolbarOperations) {
|
|
169
170
|
activateItem("props", item2, toolbarOperations(item2));
|
|
170
171
|
if (e)
|
|
171
172
|
e.stopPropagation();
|
|
173
|
+
} else if (openable) {
|
|
174
|
+
activateItem("props", item2, []);
|
|
175
|
+
if (e)
|
|
176
|
+
e.stopPropagation();
|
|
172
177
|
}
|
|
173
178
|
}
|
|
174
179
|
function on_contextmenu(e) {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import {FaChevronDown, FaChevronUp} from 'svelte-icons/fa'
|
|
3
|
+
import {i18n} from '../../i18n'
|
|
4
|
+
import {link} from 'svelte-spa-router'
|
|
3
5
|
|
|
4
6
|
export let border = false;
|
|
5
7
|
export let title = ''
|
|
6
8
|
export let collapsable = false;
|
|
7
9
|
export let onExpand = undefined
|
|
10
|
+
export let moreHref = undefined
|
|
8
11
|
|
|
9
|
-
let border_class = border ? " pt-4 mt-4 border-t border-stone-200 dark:border-stone-700" : ""
|
|
12
|
+
let border_class = border ? " pt-4 mt-4 border-t border-stone-200 dark:border-stone-700" : "mt-6"
|
|
10
13
|
let title_border = title ? border_class : ""
|
|
11
14
|
let list_border = title ? "" : border_class
|
|
12
15
|
let collapsed = true;
|
|
@@ -18,21 +21,35 @@
|
|
|
18
21
|
|
|
19
22
|
collapsed = !collapsed;
|
|
20
23
|
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
21
27
|
</script>
|
|
22
28
|
|
|
23
29
|
{#if title}
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<div class="w-full flex flex-row justify-between {title_border} mb-2">
|
|
31
|
+
<p class="text-xs uppercase font-semibold">
|
|
32
|
+
{title}
|
|
33
|
+
{#if collapsable}
|
|
34
|
+
<button class="inline-block ml-3 sm:ml-2 sm:mt-0.5 w-4 sm:w-3 h-4 sm:h-3" on:click={toggleCollapsed}>
|
|
35
|
+
{#if collapsed}
|
|
36
|
+
<FaChevronDown/>
|
|
37
|
+
{:else}
|
|
38
|
+
<FaChevronUp/>
|
|
39
|
+
{/if}
|
|
40
|
+
</button>
|
|
41
|
+
{/if}
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
{#if moreHref}
|
|
45
|
+
<p class="text-xs uppercase font-semibold mr-2 text-stone-900 dark:text-stone-400">
|
|
46
|
+
<a href={moreHref} class="text-right" use:link>
|
|
47
|
+
{i18n({en: 'More...', es: 'Más...', pl: 'Więcej...'})}
|
|
48
|
+
</a>
|
|
49
|
+
</p>
|
|
34
50
|
{/if}
|
|
35
|
-
</
|
|
51
|
+
</div>
|
|
52
|
+
|
|
36
53
|
{/if}
|
|
37
54
|
|
|
38
55
|
{#if !collapsable}
|
|
@@ -6,6 +6,7 @@ export default class Sidebar extends SvelteComponentTyped<{
|
|
|
6
6
|
border?: boolean | undefined;
|
|
7
7
|
collapsable?: boolean | undefined;
|
|
8
8
|
onExpand?: any;
|
|
9
|
+
moreHref?: any;
|
|
9
10
|
}, {
|
|
10
11
|
[evt: string]: CustomEvent<any>;
|
|
11
12
|
}, {
|
|
@@ -22,6 +23,7 @@ declare const __propDef: {
|
|
|
22
23
|
border?: boolean | undefined;
|
|
23
24
|
collapsable?: boolean | undefined;
|
|
24
25
|
onExpand?: any;
|
|
26
|
+
moreHref?: any;
|
|
25
27
|
};
|
|
26
28
|
events: {
|
|
27
29
|
[evt: string]: CustomEvent<any>;
|
package/kicks.js
CHANGED
|
@@ -100,7 +100,7 @@ function checkKicks(informObservers=true)
|
|
|
100
100
|
{
|
|
101
101
|
const s = get(session)
|
|
102
102
|
const appId = s.appId ? s.appId : 'octopus'
|
|
103
|
-
const tid = s.tid ? s.tid : 'octopus/
|
|
103
|
+
const tid = s.tid ? s.tid : 'octopus/13'
|
|
104
104
|
console.log(s.isActive, appId, tid)
|
|
105
105
|
if(s.isActive && appId && tid)
|
|
106
106
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humandialog/forms.svelte",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "Basic Svelte UI components for Object Reef applications",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@playwright/test": "^1.28.1",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"prettier-plugin-svelte": "^2.8.1",
|
|
20
20
|
"svelte": "^3.54.0",
|
|
21
21
|
"svelte-check": "^2.9.2",
|
|
22
|
+
"svelte-spa-history-router": "^2.1.1",
|
|
22
23
|
"tailwindcss": "^3.3.3",
|
|
23
24
|
"tslib": "^2.4.1",
|
|
24
25
|
"typescript": "^4.9.3",
|
package/vertical.toolbar.svelte
CHANGED
|
@@ -90,7 +90,10 @@
|
|
|
90
90
|
const tab = {
|
|
91
91
|
key: key,
|
|
92
92
|
icon: ctab.icon,
|
|
93
|
-
onclick: (e) => on_navigator_tab_clicked(e, key)
|
|
93
|
+
onclick: (e) => on_navigator_tab_clicked(e, key),
|
|
94
|
+
mountObserver: ctab.mountObserver,
|
|
95
|
+
badgeObtainerAsync: ctab.badgeObtainerAsync,
|
|
96
|
+
badgeObtainer: ctab.badgeObtainer
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
tabs.push(tab);
|
|
@@ -388,6 +391,26 @@
|
|
|
388
391
|
newGroupParams.name = '';
|
|
389
392
|
newGroupModalVisible = false;
|
|
390
393
|
}
|
|
394
|
+
|
|
395
|
+
function mountNavigator(node, tab)
|
|
396
|
+
{
|
|
397
|
+
if(!tab.mountObserver)
|
|
398
|
+
return;
|
|
399
|
+
|
|
400
|
+
const onDestroy = tab.mountObserver(rerenderTabs)
|
|
401
|
+
|
|
402
|
+
return {
|
|
403
|
+
destroy() {
|
|
404
|
+
if(onDestroy)
|
|
405
|
+
onDestroy()
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function rerenderTabs()
|
|
411
|
+
{
|
|
412
|
+
tabs = [...tabs]
|
|
413
|
+
}
|
|
391
414
|
|
|
392
415
|
</script>
|
|
393
416
|
|
|
@@ -398,11 +421,41 @@
|
|
|
398
421
|
{#each tabs as tab}
|
|
399
422
|
{@const isSelected = $navKey == tab.key}
|
|
400
423
|
<button
|
|
401
|
-
class="h-16 px-0 flex justify-center items-center w-full text-stone-300 hover:text-stone-100"
|
|
424
|
+
class="h-16 px-0 flex justify-center items-center w-full text-stone-300 hover:text-stone-100 relative"
|
|
402
425
|
class:bg-orange-500={isSelected}
|
|
403
|
-
on:click={tab.onclick}
|
|
426
|
+
on:click={tab.onclick}
|
|
427
|
+
use:mountNavigator={tab}>
|
|
404
428
|
|
|
405
429
|
<Icon s="xl" component={tab.icon}/>
|
|
430
|
+
|
|
431
|
+
{#if !isSelected}
|
|
432
|
+
{#if tab.badgeObtainer}
|
|
433
|
+
{@const badge=tab.badgeObtainer()}
|
|
434
|
+
{#if badge > 0}
|
|
435
|
+
{#if badge > 9}
|
|
436
|
+
9+
|
|
437
|
+
{:else}
|
|
438
|
+
{badge}
|
|
439
|
+
{/if}
|
|
440
|
+
{/if}
|
|
441
|
+
{:else if tab.badgeObtainerAsync}
|
|
442
|
+
{#await tab.badgeObtainerAsync() then badge}
|
|
443
|
+
{#if badge > 0}
|
|
444
|
+
<div class="absolute
|
|
445
|
+
inline-flex items-center justify-center
|
|
446
|
+
w-5 h-5
|
|
447
|
+
text-[10px] font-bold text-white bg-red-500 border-2 border-white rounded-full bottom-2 end-0 dark:border-gray-900">
|
|
448
|
+
{#if badge > 9}
|
|
449
|
+
9+
|
|
450
|
+
{:else}
|
|
451
|
+
{badge}
|
|
452
|
+
{/if}
|
|
453
|
+
</div>
|
|
454
|
+
{/if}
|
|
455
|
+
{/await}
|
|
456
|
+
{/if}
|
|
457
|
+
{/if}
|
|
458
|
+
|
|
406
459
|
</button>
|
|
407
460
|
{/each}
|
|
408
461
|
</div>
|