fuma 2.0.50 → 2.1.1
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/dist/action/index.d.ts +2 -5
- package/dist/action/index.js +2 -5
- package/dist/action/list/handlers.d.ts +6 -6
- package/dist/action/list/handlers.js +6 -5
- package/dist/action/list/index.d.ts +1 -1
- package/dist/action/list/index.js +11 -5
- package/dist/action/list/trigger.js +6 -2
- package/dist/action/list/utils.js +1 -1
- package/dist/action/tip.js +2 -2
- package/dist/command/command.svelte.d.ts +16 -0
- package/dist/command/command.svelte.js +68 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +1 -0
- package/dist/data.d.ts +87 -0
- package/dist/data.js +51 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/InputBoolean.svelte +107 -0
- package/dist/input/InputBoolean.svelte.d.ts +12 -0
- package/dist/input/InputNumber.svelte +33 -0
- package/dist/input/InputNumber.svelte.d.ts +10 -0
- package/dist/input/InputRadio.svelte +56 -0
- package/dist/input/InputRadio.svelte.d.ts +11 -0
- package/dist/input/InputRange.svelte +30 -0
- package/dist/input/InputRange.svelte.d.ts +10 -0
- package/dist/input/InputRelation.svelte +119 -0
- package/dist/input/InputRelation.svelte.d.ts +39 -0
- package/dist/input/InputSelect.svelte +113 -0
- package/dist/input/InputSelect.svelte.d.ts +37 -0
- package/dist/input/InputSelectNative.svelte +56 -0
- package/dist/input/InputSelectNative.svelte.d.ts +12 -0
- package/dist/input/InputString.svelte +48 -0
- package/dist/input/InputString.svelte.d.ts +11 -0
- package/dist/input/InputTextarea.svelte +47 -0
- package/dist/input/InputTextarea.svelte.d.ts +11 -0
- package/dist/input/Issues.svelte +21 -0
- package/dist/input/Issues.svelte.d.ts +7 -0
- package/dist/input/index.d.ts +11 -0
- package/dist/input/index.js +10 -0
- package/dist/input/type.d.ts +5 -0
- package/dist/popover/Popover.svelte +50 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/popover.svelte.d.ts +26 -0
- package/dist/popover/popover.svelte.js +101 -0
- package/dist/remote/useForm.d.ts +6 -0
- package/dist/remote/useForm.js +22 -0
- package/dist/search/Spans.svelte +15 -0
- package/dist/search/Spans.svelte.d.ts +7 -0
- package/dist/search/index.d.ts +2 -0
- package/dist/search/index.js +2 -0
- package/dist/search/search.js +96 -0
- package/dist/server/index.d.ts +0 -4
- package/dist/server/index.js +0 -4
- package/dist/server/parseQuery.js +1 -1
- package/dist/server/sse.js +4 -4
- package/dist/server/table.js +1 -1
- package/dist/state/index.d.ts +1 -0
- package/dist/state/index.js +1 -0
- package/dist/state/param.svelte.d.ts +17 -0
- package/dist/state/param.svelte.js +64 -0
- package/dist/ui/button/ButtonDelete.svelte +49 -28
- package/dist/ui/button/ButtonDelete.svelte.d.ts +12 -31
- package/dist/ui/button/index.d.ts +0 -1
- package/dist/ui/button/index.js +0 -1
- package/dist/ui/copy/ButtonCopy.svelte +43 -0
- package/dist/ui/copy/ButtonCopy.svelte.d.ts +17 -0
- package/dist/ui/copy/index.d.ts +2 -0
- package/dist/ui/copy/index.js +2 -0
- package/dist/ui/copy/useCopy.svelte.d.ts +10 -0
- package/dist/ui/copy/useCopy.svelte.js +36 -0
- package/dist/ui/dialog/Dialog.svelte +56 -26
- package/dist/ui/dialog/Dialog.svelte.d.ts +14 -35
- package/dist/ui/dialog/index.d.ts +0 -1
- package/dist/ui/dialog/index.js +0 -1
- package/dist/ui/drawer/Drawer.svelte +53 -45
- package/dist/ui/drawer/Drawer.svelte.d.ts +8 -63
- package/dist/ui/drawer/drawerFly.js +1 -1
- package/dist/ui/drawer/useLayer.svelte.d.ts +5 -0
- package/dist/ui/drawer/useLayer.svelte.js +33 -0
- package/dist/ui/index.d.ts +4 -12
- package/dist/ui/index.js +4 -12
- package/dist/ui/menu/ContextMenu.svelte +27 -26
- package/dist/ui/menu/ContextMenu.svelte.d.ts +9 -35
- package/dist/ui/menu/DropDown.svelte +44 -26
- package/dist/ui/menu/DropDown.svelte.d.ts +18 -43
- package/dist/ui/menu/DropDownMenu.svelte +51 -41
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +7 -29
- package/dist/ui/menu/dropdown.css +4 -4
- package/dist/ui/menu/index.d.ts +1 -1
- package/dist/ui/menu/index.js +2 -1
- package/dist/ui/mode/ToggleMode.svelte +25 -14
- package/dist/ui/mode/ToggleMode.svelte.d.ts +10 -35
- package/dist/ui/mode/index.d.ts +1 -1
- package/dist/ui/mode/index.js +1 -1
- package/dist/ui/mode/useMode.svelte.d.ts +8 -0
- package/dist/ui/mode/useMode.svelte.js +40 -0
- package/dist/ui/pagination/Pagination.svelte +18 -14
- package/dist/ui/pagination/Pagination.svelte.d.ts +4 -18
- package/dist/ui/range/RangePicker.svelte +3 -2
- package/dist/ui/range/RangePickerButton.svelte +49 -37
- package/dist/ui/range/RangePickerButton.svelte.d.ts +7 -21
- package/dist/ui/range/index.d.ts +1 -1
- package/dist/ui/range/index.js +1 -1
- package/dist/ui/table/Table.svelte +17 -24
- package/dist/ui/table/Table.svelte.d.ts +3 -3
- package/dist/ui/table/TableBody.svelte +1 -1
- package/dist/ui/table/TableBody.svelte.d.ts +1 -1
- package/dist/ui/table/TableFieldsEdition.svelte +90 -78
- package/dist/ui/table/TableFieldsEdition.svelte.d.ts +14 -13
- package/dist/ui/table/TableHead.svelte +1 -1
- package/dist/ui/table/TableViewSelect.svelte +71 -70
- package/dist/ui/table/TableViewSelect.svelte.d.ts +10 -23
- package/dist/ui/table/cell/TableCellArray.svelte +2 -2
- package/dist/ui/table/cell/TableCellBoolean.svelte +3 -4
- package/dist/ui/table/cell/index.d.ts +1 -1
- package/dist/ui/table/cell/index.js +1 -1
- package/dist/ui/table/field.d.ts +7 -7
- package/dist/ui/table/head/OrderButtons.svelte +18 -13
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +11 -23
- package/dist/ui/table/head/TableHeadBoolean.svelte +3 -3
- package/dist/ui/table/head/TableHeadDate.svelte +40 -56
- package/dist/ui/table/head/TableHeadDate.svelte.d.ts +1 -1
- package/dist/ui/table/head/TableHeadDefault.svelte +2 -1
- package/dist/ui/table/head/TableHeadNumber.svelte +93 -108
- package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +13 -10
- package/dist/ui/table/head/TableHeadSelect.svelte +55 -52
- package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +13 -10
- package/dist/ui/table/head/TableHeadString.svelte +28 -34
- package/dist/ui/table/head/index.d.ts +3 -3
- package/dist/ui/table/head/index.js +3 -3
- package/dist/ui/table/index.d.ts +5 -5
- package/dist/ui/table/index.js +4 -5
- package/dist/utils/csv.js +1 -1
- package/dist/utils/eventEmitter.d.ts +2 -2
- package/dist/utils/eventEmitter.js +18 -11
- package/dist/utils/index.d.ts +4 -6
- package/dist/utils/index.js +4 -6
- package/dist/utils/normalizePath.js +1 -1
- package/dist/utils/options.d.ts +6 -5
- package/dist/utils/options.js +3 -2
- package/dist/utils/tippy.d.ts +1 -1
- package/dist/utils/tippy.js +1 -1
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/index.js +0 -1
- package/dist/validation/zod.d.ts +12 -393
- package/dist/validation/zod.js +22 -82
- package/package.json +115 -134
- package/dist/action/heightScreen.d.ts +0 -10
- package/dist/action/heightScreen.js +0 -24
- package/dist/action/portal.d.ts +0 -3
- package/dist/action/portal.js +0 -9
- package/dist/action/selector.d.ts +0 -15
- package/dist/action/selector.js +0 -71
- package/dist/api/client.d.ts +0 -3
- package/dist/api/client.js +0 -24
- package/dist/api/config.d.ts +0 -46
- package/dist/api/config.js +0 -7
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.js +0 -3
- package/dist/api/server.d.ts +0 -11
- package/dist/api/server.js +0 -17
- package/dist/private/Meta.svelte +0 -16
- package/dist/private/Meta.svelte.d.ts +0 -30
- package/dist/private/api.d.ts +0 -61
- package/dist/private/api.js +0 -10
- package/dist/private/constant.d.ts +0 -14
- package/dist/private/constant.js +0 -6
- package/dist/private/model.d.ts +0 -70
- package/dist/private/model.js +0 -25
- package/dist/private/prisma.d.ts +0 -2
- package/dist/private/prisma.js +0 -2
- package/dist/private/store.d.ts +0 -1
- package/dist/private/store.js +0 -2
- package/dist/server/auth.d.ts +0 -12
- package/dist/server/auth.js +0 -15
- package/dist/server/formAction.d.ts +0 -13
- package/dist/server/formAction.js +0 -8
- package/dist/server/json.d.ts +0 -1
- package/dist/server/json.js +0 -16
- package/dist/server/parseFormData.d.ts +0 -10
- package/dist/server/parseFormData.js +0 -85
- package/dist/server/try.d.ts +0 -9
- package/dist/server/try.js +0 -41
- package/dist/store/index.d.ts +0 -2
- package/dist/store/index.js +0 -2
- package/dist/store/isSmallScreen.d.ts +0 -1
- package/dist/store/isSmallScreen.js +0 -14
- package/dist/store/param.d.ts +0 -22
- package/dist/store/param.js +0 -61
- package/dist/store/session.d.ts +0 -1
- package/dist/store/session.js +0 -13
- package/dist/ui/badge/Badge.svelte +0 -9
- package/dist/ui/badge/Badge.svelte.d.ts +0 -21
- package/dist/ui/badge/index.d.ts +0 -1
- package/dist/ui/badge/index.js +0 -1
- package/dist/ui/button/ButtonCopy.svelte +0 -59
- package/dist/ui/button/ButtonCopy.svelte.d.ts +0 -27
- package/dist/ui/card/Card.svelte +0 -43
- package/dist/ui/card/Card.svelte.d.ts +0 -41
- package/dist/ui/card/CardBasic.svelte +0 -15
- package/dist/ui/card/CardBasic.svelte.d.ts +0 -31
- package/dist/ui/card/CardCollapse.svelte +0 -71
- package/dist/ui/card/CardCollapse.svelte.d.ts +0 -39
- package/dist/ui/card/CardFullScreen.svelte +0 -31
- package/dist/ui/card/CardFullScreen.svelte.d.ts +0 -38
- package/dist/ui/card/CardLink.svelte +0 -22
- package/dist/ui/card/CardLink.svelte.d.ts +0 -31
- package/dist/ui/card/index.d.ts +0 -5
- package/dist/ui/card/index.js +0 -5
- package/dist/ui/context.d.ts +0 -6
- package/dist/ui/context.js +0 -12
- package/dist/ui/dialog/DialogConfirm.svelte +0 -24
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +0 -35
- package/dist/ui/drawer/layers.d.ts +0 -7
- package/dist/ui/drawer/layers.js +0 -68
- package/dist/ui/form/Form.svelte +0 -168
- package/dist/ui/form/Form.svelte.d.ts +0 -62
- package/dist/ui/form/FormInput.svelte +0 -15
- package/dist/ui/form/FormSection.svelte +0 -78
- package/dist/ui/form/FormSection.svelte.d.ts +0 -39
- package/dist/ui/form/form.d.ts +0 -37
- package/dist/ui/form/form.js +0 -57
- package/dist/ui/form/formInput.js +0 -33
- package/dist/ui/form/index.d.ts +0 -3
- package/dist/ui/form/index.js +0 -3
- package/dist/ui/icon/Icon.svelte +0 -53
- package/dist/ui/icon/Icon.svelte.d.ts +0 -29
- package/dist/ui/icon/index.d.ts +0 -1
- package/dist/ui/icon/index.js +0 -1
- package/dist/ui/input/FormControl.svelte +0 -77
- package/dist/ui/input/FormControl.svelte.d.ts +0 -34
- package/dist/ui/input/InputBoolean.svelte +0 -33
- package/dist/ui/input/InputBoolean.svelte.d.ts +0 -46
- package/dist/ui/input/InputCheckboxs.svelte +0 -71
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +0 -57
- package/dist/ui/input/InputCheckboxsMenu.svelte +0 -106
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +0 -59
- package/dist/ui/input/InputCheckboxsTree.svelte +0 -18
- package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +0 -25
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +0 -68
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +0 -27
- package/dist/ui/input/InputCombo.svelte +0 -99
- package/dist/ui/input/InputCombo.svelte.d.ts +0 -59
- package/dist/ui/input/InputDate.svelte +0 -47
- package/dist/ui/input/InputDate.svelte.d.ts +0 -46
- package/dist/ui/input/InputDateTime.svelte +0 -41
- package/dist/ui/input/InputDateTime.svelte.d.ts +0 -23
- package/dist/ui/input/InputImage.svelte +0 -116
- package/dist/ui/input/InputImage.svelte.d.ts +0 -48
- package/dist/ui/input/InputImagePreview.svelte +0 -60
- package/dist/ui/input/InputImagePreview.svelte.d.ts +0 -27
- package/dist/ui/input/InputNumber.svelte +0 -31
- package/dist/ui/input/InputNumber.svelte.d.ts +0 -23
- package/dist/ui/input/InputOptionInParam.svelte +0 -36
- package/dist/ui/input/InputOptionInParam.svelte.d.ts +0 -24
- package/dist/ui/input/InputOptions.svelte +0 -85
- package/dist/ui/input/InputOptions.svelte.d.ts +0 -21
- package/dist/ui/input/InputPassword.svelte +0 -25
- package/dist/ui/input/InputPassword.svelte.d.ts +0 -45
- package/dist/ui/input/InputRadio.svelte +0 -84
- package/dist/ui/input/InputRadio.svelte.d.ts +0 -56
- package/dist/ui/input/InputRelation.svelte +0 -171
- package/dist/ui/input/InputRelation.svelte.d.ts +0 -76
- package/dist/ui/input/InputRelations.svelte +0 -166
- package/dist/ui/input/InputRelations.svelte.d.ts +0 -55
- package/dist/ui/input/InputSearch.svelte +0 -59
- package/dist/ui/input/InputSearch.svelte.d.ts +0 -29
- package/dist/ui/input/InputSelect.svelte +0 -84
- package/dist/ui/input/InputSelect.svelte.d.ts +0 -29
- package/dist/ui/input/InputText.svelte +0 -46
- package/dist/ui/input/InputText.svelte.d.ts +0 -30
- package/dist/ui/input/InputTextarea.svelte +0 -23
- package/dist/ui/input/InputTextarea.svelte.d.ts +0 -23
- package/dist/ui/input/InputTime.svelte +0 -47
- package/dist/ui/input/InputTime.svelte.d.ts +0 -46
- package/dist/ui/input/RelationAfter.svelte +0 -34
- package/dist/ui/input/RelationAfter.svelte.d.ts +0 -26
- package/dist/ui/input/SelectorList.svelte +0 -50
- package/dist/ui/input/SelectorList.svelte.d.ts +0 -49
- package/dist/ui/input/action.d.ts +0 -13
- package/dist/ui/input/action.js +0 -56
- package/dist/ui/input/index.d.ts +0 -26
- package/dist/ui/input/index.js +0 -26
- package/dist/ui/input/textRich/InputTextRich.svelte +0 -72
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +0 -48
- package/dist/ui/input/textRich/SuggesionList.svelte +0 -25
- package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMark.svelte +0 -22
- package/dist/ui/input/textRich/ToolMark.svelte.d.ts +0 -25
- package/dist/ui/input/textRich/ToolMarkColor.svelte +0 -36
- package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMarkLink.svelte +0 -72
- package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolMenu.svelte +0 -66
- package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +0 -33
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +0 -50
- package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +0 -54
- package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMenuNode.svelte +0 -60
- package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolsBar.svelte +0 -61
- package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +0 -24
- package/dist/ui/input/textRich/extensions.d.ts +0 -2
- package/dist/ui/input/textRich/extensions.js +0 -62
- package/dist/ui/input/textRich/indent.d.ts +0 -13
- package/dist/ui/input/textRich/indent.js +0 -112
- package/dist/ui/input/textRich/index.d.ts +0 -3
- package/dist/ui/input/textRich/index.js +0 -3
- package/dist/ui/input/textRich/suggestion.d.ts +0 -7
- package/dist/ui/input/textRich/suggestion.js +0 -55
- package/dist/ui/input/textRich/tiptapParser.d.ts +0 -4
- package/dist/ui/input/textRich/tiptapParser.js +0 -29
- package/dist/ui/input/types.d.ts +0 -15
- package/dist/ui/input/types.js +0 -1
- package/dist/ui/login/Login.svelte +0 -99
- package/dist/ui/login/Login.svelte.d.ts +0 -20
- package/dist/ui/login/index.d.ts +0 -1
- package/dist/ui/login/index.js +0 -1
- package/dist/ui/placeholder/Placeholder.svelte +0 -12
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +0 -30
- package/dist/ui/placeholder/PlaceholderImage.svelte +0 -16
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +0 -30
- package/dist/ui/placeholder/index.d.ts +0 -2
- package/dist/ui/placeholder/index.js +0 -2
- package/dist/ui/table/type.d.ts +0 -2
- package/dist/ui/tabs/Tabs.svelte +0 -32
- package/dist/ui/tabs/Tabs.svelte.d.ts +0 -22
- package/dist/ui/tabs/TabsIcon.svelte +0 -60
- package/dist/ui/tabs/TabsIcon.svelte.d.ts +0 -24
- package/dist/ui/tabs/index.d.ts +0 -8
- package/dist/ui/tabs/index.js +0 -2
- package/dist/utils/avatar.d.ts +0 -1
- package/dist/utils/avatar.js +0 -5
- package/dist/utils/component.d.ts +0 -6
- package/dist/utils/component.js +0 -3
- package/dist/validation/form.d.ts +0 -34
- package/dist/validation/form.js +0 -103
- /package/dist/{ui/table → input}/type.js +0 -0
package/dist/private/Meta.svelte
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Card } from '../ui/card/index.js'
|
|
3
|
-
|
|
4
|
-
export let name = ''
|
|
5
|
-
export let description = ''
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<Card class="mx-auto mb-6 max-w-4xl">
|
|
9
|
-
<div slot="title" class="flex items-center gap-4">
|
|
10
|
-
<span class="grow">{name}</span>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<svelte:fragment slot="subtitle">{description}</svelte:fragment>
|
|
14
|
-
|
|
15
|
-
<slot />
|
|
16
|
-
</Card>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const Meta: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
name?: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
}, {
|
|
23
|
-
default: {};
|
|
24
|
-
}>, {
|
|
25
|
-
[evt: string]: CustomEvent<any>;
|
|
26
|
-
}, {
|
|
27
|
-
default: {};
|
|
28
|
-
}, {}, string>;
|
|
29
|
-
type Meta = InstanceType<typeof Meta>;
|
|
30
|
-
export default Meta;
|
package/dist/private/api.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Prisma } from '@prisma/client';
|
|
2
|
-
export declare const apiConfig: {
|
|
3
|
-
Tag: (search: string) => {
|
|
4
|
-
where: {
|
|
5
|
-
name: {
|
|
6
|
-
contains: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
Post: (search: string) => {
|
|
11
|
-
where: {
|
|
12
|
-
tags: {
|
|
13
|
-
some: {
|
|
14
|
-
name: {
|
|
15
|
-
contains: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
include: {
|
|
21
|
-
tags: true;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
PostType: (search: string) => {
|
|
25
|
-
where: {
|
|
26
|
-
name: {
|
|
27
|
-
contains: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export declare const api: import("../api/config.js").ApiClient<Prisma.TypeMap<import("@prisma/client/runtime/library").DefaultArgs, {}>, {
|
|
33
|
-
Tag: (search: string) => {
|
|
34
|
-
where: {
|
|
35
|
-
name: {
|
|
36
|
-
contains: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
Post: (search: string) => {
|
|
41
|
-
where: {
|
|
42
|
-
tags: {
|
|
43
|
-
some: {
|
|
44
|
-
name: {
|
|
45
|
-
contains: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
include: {
|
|
51
|
-
tags: true;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
PostType: (search: string) => {
|
|
55
|
-
where: {
|
|
56
|
-
name: {
|
|
57
|
-
contains: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
}>;
|
package/dist/private/api.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useApiClient } from '../api/client.js';
|
|
2
|
-
export const apiConfig = {
|
|
3
|
-
Tag: (search) => ({ where: { name: { contains: search } } }),
|
|
4
|
-
Post: (search) => ({
|
|
5
|
-
where: { tags: { some: { name: { contains: search } } } },
|
|
6
|
-
include: { tags: true }
|
|
7
|
-
}),
|
|
8
|
-
PostType: (search) => ({ where: { name: { contains: search } } })
|
|
9
|
-
};
|
|
10
|
-
export const api = useApiClient(apiConfig);
|
package/dist/private/constant.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { mdiAccountGroup, mdiFileLockOutline, mdiWeb } from '@mdi/js';
|
|
2
|
-
export const POST_PUBLICATION = {
|
|
3
|
-
private: { label: 'Private', icon: mdiFileLockOutline },
|
|
4
|
-
friends: { label: 'Friends', icon: mdiAccountGroup },
|
|
5
|
-
public: { label: 'Public', icon: mdiWeb }
|
|
6
|
-
};
|
package/dist/private/model.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export declare const modelPost: {
|
|
2
|
-
title: import("zod").ZodString;
|
|
3
|
-
content: import("zod").ZodString;
|
|
4
|
-
isFavourite: import("zod").ZodBoolean;
|
|
5
|
-
likeCount: import("zod").ZodNumber;
|
|
6
|
-
writingAt: import("zod").ZodDate;
|
|
7
|
-
writingDuration: import("zod").ZodDate;
|
|
8
|
-
isInteressing: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
9
|
-
viewCounter: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
10
|
-
publishedAt: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
|
|
11
|
-
publishedAtTime: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
|
|
12
|
-
publication: import("zod").ZodEnum<{
|
|
13
|
-
private: "private";
|
|
14
|
-
friends: "friends";
|
|
15
|
-
public: "public";
|
|
16
|
-
}>;
|
|
17
|
-
type: import("zod").ZodPipe<import("zod").ZodObject<{
|
|
18
|
-
id: import("zod").ZodString;
|
|
19
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
|
|
20
|
-
connect: {
|
|
21
|
-
id: string;
|
|
22
|
-
};
|
|
23
|
-
}, {
|
|
24
|
-
id: string;
|
|
25
|
-
}>>;
|
|
26
|
-
tags: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodObject<{
|
|
27
|
-
id: import("zod").ZodString;
|
|
28
|
-
}, import("zod/v4/core").$strip>>, import("zod").ZodTransform<Partial<Record<"set" | "delete" | "connect" | "disconnect", {
|
|
29
|
-
id: string;
|
|
30
|
-
}[]>>, {
|
|
31
|
-
id: string;
|
|
32
|
-
}[]>>;
|
|
33
|
-
};
|
|
34
|
-
export declare const modelPostUpdate: {
|
|
35
|
-
id: import("zod").ZodString;
|
|
36
|
-
tags: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodObject<{
|
|
37
|
-
id: import("zod").ZodString;
|
|
38
|
-
}, import("zod/v4/core").$strip>>, import("zod").ZodTransform<Partial<Record<"set" | "delete" | "connect" | "disconnect", {
|
|
39
|
-
id: string;
|
|
40
|
-
}[]>>, {
|
|
41
|
-
id: string;
|
|
42
|
-
}[]>>;
|
|
43
|
-
title: import("zod").ZodString;
|
|
44
|
-
content: import("zod").ZodString;
|
|
45
|
-
isFavourite: import("zod").ZodBoolean;
|
|
46
|
-
likeCount: import("zod").ZodNumber;
|
|
47
|
-
writingAt: import("zod").ZodDate;
|
|
48
|
-
writingDuration: import("zod").ZodDate;
|
|
49
|
-
isInteressing: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
50
|
-
viewCounter: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
51
|
-
publishedAt: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
|
|
52
|
-
publishedAtTime: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
|
|
53
|
-
publication: import("zod").ZodEnum<{
|
|
54
|
-
private: "private";
|
|
55
|
-
friends: "friends";
|
|
56
|
-
public: "public";
|
|
57
|
-
}>;
|
|
58
|
-
type: import("zod").ZodPipe<import("zod").ZodObject<{
|
|
59
|
-
id: import("zod").ZodString;
|
|
60
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
|
|
61
|
-
connect: {
|
|
62
|
-
id: string;
|
|
63
|
-
};
|
|
64
|
-
}, {
|
|
65
|
-
id: string;
|
|
66
|
-
}>>;
|
|
67
|
-
};
|
|
68
|
-
export declare const modelTag: {
|
|
69
|
-
name: import("zod").ZodString;
|
|
70
|
-
};
|
package/dist/private/model.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { toTuple, z } from '../validation/zod.js';
|
|
2
|
-
import { POST_PUBLICATION } from './constant.js';
|
|
3
|
-
export const modelPost = {
|
|
4
|
-
title: z.string().min(1, 'Required'),
|
|
5
|
-
content: z.string().min(10),
|
|
6
|
-
isFavourite: z.boolean(),
|
|
7
|
-
likeCount: z.number(),
|
|
8
|
-
writingAt: z.date(),
|
|
9
|
-
writingDuration: z.date(),
|
|
10
|
-
isInteressing: z.boolean().optional(),
|
|
11
|
-
viewCounter: z.number().optional(),
|
|
12
|
-
publishedAt: z.date().optional().nullable(),
|
|
13
|
-
publishedAtTime: z.date().optional().nullable(),
|
|
14
|
-
publication: z.enum(toTuple(POST_PUBLICATION)),
|
|
15
|
-
type: z.relation.connect,
|
|
16
|
-
tags: z.relations.connect
|
|
17
|
-
};
|
|
18
|
-
export const modelPostUpdate = {
|
|
19
|
-
...modelPost,
|
|
20
|
-
id: z.string(),
|
|
21
|
-
tags: z.relations.set
|
|
22
|
-
};
|
|
23
|
-
export const modelTag = {
|
|
24
|
-
name: z.string().min(1, 'Required')
|
|
25
|
-
};
|
package/dist/private/prisma.d.ts
DELETED
package/dist/private/prisma.js
DELETED
package/dist/private/store.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare let drawerTransitionX: import("svelte/store").Writable<number>;
|
package/dist/private/store.js
DELETED
package/dist/server/auth.d.ts
DELETED
package/dist/server/auth.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Lucia } from 'lucia';
|
|
2
|
-
import { dev } from '$app/environment';
|
|
3
|
-
import { PrismaAdapter } from '@lucia-auth/adapter-prisma';
|
|
4
|
-
import { prisma } from '../private/prisma.js';
|
|
5
|
-
const adapter = new PrismaAdapter(prisma.session, prisma.user);
|
|
6
|
-
export const lucia = new Lucia(adapter, {
|
|
7
|
-
sessionCookie: {
|
|
8
|
-
attributes: {
|
|
9
|
-
secure: !dev
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
getUserAttributes: (attributes) => ({
|
|
13
|
-
username: attributes.username
|
|
14
|
-
})
|
|
15
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { RequestEvent } from '@sveltejs/kit';
|
|
3
|
-
export declare function formAction<E extends RequestEvent, Shape extends z.core.$ZodShape = z.core.$ZodShape, ReturnType extends unknown = unknown>(shapes: Shape | Shape[], func: (arg: E & {
|
|
4
|
-
event: E;
|
|
5
|
-
data: z.core.$InferObjectOutput<Shape, {}>;
|
|
6
|
-
formData: FormData;
|
|
7
|
-
}) => Promise<ReturnType>, options?: {
|
|
8
|
-
redirectTo?: string | URL | ((res: ReturnType) => string | URL | undefined);
|
|
9
|
-
}): (event: E) => Promise<import("@sveltejs/kit").ActionFailure<{
|
|
10
|
-
message: string;
|
|
11
|
-
} | {
|
|
12
|
-
issues: import("./parseFormData.js").Issue[];
|
|
13
|
-
}> | ReturnType>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { parseFormData } from './parseFormData.js';
|
|
2
|
-
import { tryOrFail } from './try.js';
|
|
3
|
-
export function formAction(shapes, func, options = {}) {
|
|
4
|
-
return (event) => tryOrFail(async () => {
|
|
5
|
-
const { data, formData } = await parseFormData(event.request, shapes); //, options.validation)
|
|
6
|
-
return func({ ...event, event, data, formData });
|
|
7
|
-
}, options.redirectTo);
|
|
8
|
-
}
|
package/dist/server/json.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function json(data: unknown, init?: ResponseInit): Response;
|
package/dist/server/json.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as devalue from 'devalue';
|
|
2
|
-
export function json(data, init) {
|
|
3
|
-
const body = devalue.stringify(data);
|
|
4
|
-
const headers = new Headers(init?.headers);
|
|
5
|
-
if (!headers.has('content-length')) {
|
|
6
|
-
headers.set('content-length', encoder.encode(body).byteLength.toString());
|
|
7
|
-
}
|
|
8
|
-
if (!headers.has('content-type')) {
|
|
9
|
-
headers.set('content-type', 'application/json');
|
|
10
|
-
}
|
|
11
|
-
return new Response(body, {
|
|
12
|
-
...init,
|
|
13
|
-
headers,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
const encoder = new TextEncoder();
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
export type Issue = z.core.$ZodIssue & {
|
|
3
|
-
received: string;
|
|
4
|
-
expected: string;
|
|
5
|
-
unionErrors?: z.ZodError[];
|
|
6
|
-
};
|
|
7
|
-
export declare function parseFormData<Shape extends z.core.$ZodShape>(requestOrFormData: Request | FormData, shapes: Shape | Shape[]): Promise<{
|
|
8
|
-
data: z.z.core.$InferObjectOutput<{ -readonly [P in keyof Shape]: Shape[P]; }, {}>;
|
|
9
|
-
formData: FormData;
|
|
10
|
-
}>;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { USE_COERCE_BOOLEAN, USE_COERCE_DATE, USE_COERCE_JSON, USE_COERCE_NUMBER } from '../utils/constant.js';
|
|
2
|
-
import { jsonParse } from '../utils/jsonParse.js';
|
|
3
|
-
import z from 'zod';
|
|
4
|
-
export async function parseFormData(requestOrFormData, shapes
|
|
5
|
-
//validation?: (arg: z.core.output<Shape>, ctx: z.core.$RefinementCtx<z.core.output<Shape>>) => void
|
|
6
|
-
) {
|
|
7
|
-
const formData = requestOrFormData instanceof Request ? await requestOrFormData.formData() : requestOrFormData;
|
|
8
|
-
const [firstShap, ...unionShaps] = Array.isArray(shapes) ? shapes : [shapes];
|
|
9
|
-
const shema = z.object(firstShap); //.superRefine(validation)
|
|
10
|
-
unionShaps.forEach((shap) => shema.or(z.object(shap)));
|
|
11
|
-
const formDataFlateObject = Object.fromEntries(formData);
|
|
12
|
-
const formDataFlateObjectCoerced = coerceFlateData(formDataFlateObject);
|
|
13
|
-
const formDataObject = flateToNeestedObject(formDataFlateObjectCoerced);
|
|
14
|
-
const parsed = shema.safeParse(formDataObject);
|
|
15
|
-
if (parsed.success === false) {
|
|
16
|
-
const issueToPOJO = (issue) => ({
|
|
17
|
-
message: issue.message,
|
|
18
|
-
path: issue.path,
|
|
19
|
-
code: issue.code,
|
|
20
|
-
received: issue.received,
|
|
21
|
-
expected: issue.expected,
|
|
22
|
-
unionErrors: issue.unionErrors?.map((err) => err.flatten())
|
|
23
|
-
});
|
|
24
|
-
const issues = parsed.error.issues.map(issueToPOJO);
|
|
25
|
-
throw { issues };
|
|
26
|
-
}
|
|
27
|
-
return { data: parsed.data, formData };
|
|
28
|
-
}
|
|
29
|
-
function coerceFlateData(flateData) {
|
|
30
|
-
const isNotDefined = (value) => value === '' || value === 'null' || value === 'undefined';
|
|
31
|
-
const coerceMap = {
|
|
32
|
-
[USE_COERCE_JSON]: (value) => jsonParse(value, {}),
|
|
33
|
-
[USE_COERCE_DATE]: (value) => (isNotDefined(value) ? null : new Date(value)),
|
|
34
|
-
[USE_COERCE_NUMBER]: (value) => (isNotDefined(value) ? null : +value),
|
|
35
|
-
[USE_COERCE_BOOLEAN]: (value) => value === 'true'
|
|
36
|
-
};
|
|
37
|
-
function coerceValue(value) {
|
|
38
|
-
if (typeof value !== 'string')
|
|
39
|
-
return value;
|
|
40
|
-
const coerce = Object.entries(coerceMap).find(([TOKEN]) => value.startsWith(TOKEN));
|
|
41
|
-
if (!coerce)
|
|
42
|
-
return value;
|
|
43
|
-
return coerce[1](value.replace(coerce[0], ''));
|
|
44
|
-
}
|
|
45
|
-
return Object.entries(flateData).reduce((acc, [key, value]) => ({ ...acc, [key]: coerceValue(value) }), {});
|
|
46
|
-
}
|
|
47
|
-
function flateToNeestedObject(flatObject) {
|
|
48
|
-
const obj = {};
|
|
49
|
-
Object.entries(flatObject).forEach(([key, value]) => {
|
|
50
|
-
set(obj, key, value);
|
|
51
|
-
});
|
|
52
|
-
return obj;
|
|
53
|
-
}
|
|
54
|
-
function set(obj, path, value) {
|
|
55
|
-
if (typeof path === 'number')
|
|
56
|
-
path = [path];
|
|
57
|
-
if (!path || path.length === 0)
|
|
58
|
-
return obj;
|
|
59
|
-
if (typeof path === 'string')
|
|
60
|
-
return set(obj, path.split('.').map(getKey), value);
|
|
61
|
-
const currentPath = path[0];
|
|
62
|
-
const currentValue = obj[currentPath];
|
|
63
|
-
if (path.length === 1) {
|
|
64
|
-
if (currentValue === undefined) {
|
|
65
|
-
obj[currentPath] = value;
|
|
66
|
-
}
|
|
67
|
-
return currentValue;
|
|
68
|
-
}
|
|
69
|
-
if (currentValue === undefined) {
|
|
70
|
-
//check if we assume an array
|
|
71
|
-
if (typeof path[1] === 'number') {
|
|
72
|
-
obj[currentPath] = [];
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
obj[currentPath] = {};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return set(obj[currentPath], path.slice(1), value);
|
|
79
|
-
}
|
|
80
|
-
function getKey(key) {
|
|
81
|
-
const intKey = parseInt(key);
|
|
82
|
-
if (intKey.toString() === key)
|
|
83
|
-
return intKey;
|
|
84
|
-
return key;
|
|
85
|
-
}
|
package/dist/server/try.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type ActionFailure } from '@sveltejs/kit';
|
|
2
|
-
import type { Issue } from './parseFormData.js';
|
|
3
|
-
export declare function tryOrFail<T = unknown>(func: () => Promise<T>,
|
|
4
|
-
/** You can redirect on success */
|
|
5
|
-
redirectTo?: string | URL | ((res: T) => string | URL | undefined)): Promise<T | ActionFailure<{
|
|
6
|
-
message: string;
|
|
7
|
-
} | {
|
|
8
|
-
issues: Issue[];
|
|
9
|
-
}>>;
|
package/dist/server/try.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { fail, redirect } from '@sveltejs/kit';
|
|
2
|
-
export async function tryOrFail(func,
|
|
3
|
-
/** You can redirect on success */
|
|
4
|
-
redirectTo) {
|
|
5
|
-
let result = null;
|
|
6
|
-
let isSuccess = false;
|
|
7
|
-
try {
|
|
8
|
-
result = await func();
|
|
9
|
-
isSuccess = true;
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
// Handle Classic error
|
|
14
|
-
if ('status' in error && 'body' in error && 'message' in error.body) {
|
|
15
|
-
return fail(error.status, { message: error.body.message });
|
|
16
|
-
}
|
|
17
|
-
// Handle Prisma error
|
|
18
|
-
if ('meta' in error && error.meta && 'cause' in error.meta) {
|
|
19
|
-
return fail(400, { message: error.meta.cause });
|
|
20
|
-
}
|
|
21
|
-
// Handle parseFormData error
|
|
22
|
-
if ('issues' in error) {
|
|
23
|
-
return fail(400, { issues: error.issues });
|
|
24
|
-
}
|
|
25
|
-
const { message } = error;
|
|
26
|
-
return fail(400, { message });
|
|
27
|
-
}
|
|
28
|
-
finally {
|
|
29
|
-
if (isSuccess && redirectTo) {
|
|
30
|
-
if (typeof redirectTo === 'string' || redirectTo instanceof URL)
|
|
31
|
-
redirect(302, redirectTo);
|
|
32
|
-
else if (result) {
|
|
33
|
-
const url = redirectTo(result);
|
|
34
|
-
if (url)
|
|
35
|
-
redirect(302, url);
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
console.warn('No result can be provide in redirectTo() function. Please use a simple string.');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
package/dist/store/index.d.ts
DELETED
package/dist/store/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isSmallScreen: import("svelte/store").Readable<boolean>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { browser } from '$app/environment';
|
|
2
|
-
import { readable } from 'svelte/store';
|
|
3
|
-
const getValue = () => browser && document.body.clientWidth < 600;
|
|
4
|
-
export const isSmallScreen = readable(getValue(), (set) => {
|
|
5
|
-
if (!browser)
|
|
6
|
-
return;
|
|
7
|
-
const update = () => {
|
|
8
|
-
set(getValue());
|
|
9
|
-
};
|
|
10
|
-
window.addEventListener('resize', update);
|
|
11
|
-
return () => {
|
|
12
|
-
window.removeEventListener('resize', update);
|
|
13
|
-
};
|
|
14
|
-
});
|
package/dist/store/param.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const param: import("svelte/store").Readable<{
|
|
2
|
-
with: (params: Record<string, string | number>, ...keysToRemove: string[]) => string;
|
|
3
|
-
without: (...keys: string[]) => string;
|
|
4
|
-
toggle: (params: Record<string, string>, ...keysToRemove: string[]) => string;
|
|
5
|
-
/** Check if key exist in url params */
|
|
6
|
-
has: (key: string) => boolean;
|
|
7
|
-
get: (key: string) => string | null;
|
|
8
|
-
/** Check if value match in url params */
|
|
9
|
-
hasValue: (key: string, value: string) => boolean;
|
|
10
|
-
page: import("@sveltejs/kit").Page<Record<string, string>, string | null>;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const urlParam: import("svelte/store").Readable<{
|
|
13
|
-
with: (params: Record<string, string | number>, ...keysToRemove: string[]) => string;
|
|
14
|
-
without: (...keys: string[]) => string;
|
|
15
|
-
toggle: (params: Record<string, string>, ...keysToRemove: string[]) => string;
|
|
16
|
-
/** Check if key exist in url params */
|
|
17
|
-
has: (key: string) => boolean;
|
|
18
|
-
get: (key: string) => string | null;
|
|
19
|
-
/** Check if value match in url params */
|
|
20
|
-
hasValue: (key: string, value: string) => boolean;
|
|
21
|
-
page: import("@sveltejs/kit").Page<Record<string, string>, string | null>;
|
|
22
|
-
}>;
|
package/dist/store/param.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { derived } from 'svelte/store';
|
|
2
|
-
import { page } from '$app/stores';
|
|
3
|
-
export const param = derived(page, (_page) => {
|
|
4
|
-
/** Return new url with new params */
|
|
5
|
-
const _with = (params, ...keysToRemove) => {
|
|
6
|
-
const url = new URL(_page.url);
|
|
7
|
-
Object.entries(params).forEach(([key, value]) => url.searchParams.set(key, String(value)));
|
|
8
|
-
keysToRemove.forEach((key) => url.searchParams.delete(key));
|
|
9
|
-
return url.search;
|
|
10
|
-
};
|
|
11
|
-
/** Return new url without params keys provided */
|
|
12
|
-
const without = (...keys) => {
|
|
13
|
-
const url = new URL(_page.url);
|
|
14
|
-
keys.forEach((key) => url.searchParams.delete(key));
|
|
15
|
-
return url.search;
|
|
16
|
-
};
|
|
17
|
-
/** Return new url with toggle params */
|
|
18
|
-
const toggle = (params, ...keysToRemove) => {
|
|
19
|
-
const url = new URL(_page.url);
|
|
20
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
21
|
-
if (url.searchParams.get(key) === value)
|
|
22
|
-
url.searchParams.delete(key);
|
|
23
|
-
else
|
|
24
|
-
url.searchParams.set(key, value);
|
|
25
|
-
});
|
|
26
|
-
keysToRemove.forEach((key) => url.searchParams.delete(key));
|
|
27
|
-
return url.search;
|
|
28
|
-
};
|
|
29
|
-
return {
|
|
30
|
-
with: _with,
|
|
31
|
-
without,
|
|
32
|
-
toggle,
|
|
33
|
-
/** Check if key exist in url params */
|
|
34
|
-
has: (key) => _page.url.searchParams.has(key),
|
|
35
|
-
get: (key) => _page.url.searchParams.get(key),
|
|
36
|
-
/** Check if value match in url params */
|
|
37
|
-
hasValue: (key, value) => _page.url.searchParams.get(key) === value,
|
|
38
|
-
page: _page
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
export const urlParam = derived(param, (_param) => {
|
|
42
|
-
const { pathname } = _param.page.url;
|
|
43
|
-
/** Return new url with new params */
|
|
44
|
-
const _with = (params, ...keysToRemove) => {
|
|
45
|
-
return pathname + _param.with(params, ...keysToRemove);
|
|
46
|
-
};
|
|
47
|
-
/** Return new url without params keys provided */
|
|
48
|
-
const without = (...keys) => {
|
|
49
|
-
return pathname + _param.without(...keys);
|
|
50
|
-
};
|
|
51
|
-
/** Return new url with toggle params */
|
|
52
|
-
const toggle = (params, ...keysToRemove) => {
|
|
53
|
-
return pathname + _param.toggle(params, ...keysToRemove);
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
..._param,
|
|
57
|
-
with: _with,
|
|
58
|
-
without,
|
|
59
|
-
toggle
|
|
60
|
-
};
|
|
61
|
-
});
|
package/dist/store/session.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function sessionStore<T>(key: string, value: T): import("svelte/store").Writable<T>;
|
package/dist/store/session.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { writable } from 'svelte/store';
|
|
2
|
-
import { browser } from '$app/environment';
|
|
3
|
-
import { jsonParse } from '../utils/index.js';
|
|
4
|
-
export function sessionStore(key, value) {
|
|
5
|
-
if (!browser)
|
|
6
|
-
return writable(value);
|
|
7
|
-
const initialValue = jsonParse(sessionStorage.getItem(key), value);
|
|
8
|
-
const store = writable(initialValue);
|
|
9
|
-
store.subscribe((newValue) => {
|
|
10
|
-
sessionStorage.setItem(key, JSON.stringify(newValue));
|
|
11
|
-
});
|
|
12
|
-
return store;
|
|
13
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const Badge: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
class?: string;
|
|
16
|
-
content: string;
|
|
17
|
-
}, {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
}, {}, {}, string>;
|
|
20
|
-
type Badge = InstanceType<typeof Badge>;
|
|
21
|
-
export default Badge;
|
package/dist/ui/badge/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Badge } from './Badge.svelte';
|
package/dist/ui/badge/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Badge } from './Badge.svelte';
|