lapikit 0.4.14 → 0.4.15
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/@types/animations.d.ts +7 -0
- package/dist/@types/components.d.ts +33 -0
- package/dist/@types/core.d.ts +3 -0
- package/dist/@types/dom.d.ts +7 -0
- package/dist/@types/dom.js +1 -0
- package/dist/@types/events.d.ts +4 -0
- package/dist/@types/events.js +1 -0
- package/dist/@types/index.d.ts +6 -0
- package/dist/@types/index.js +6 -0
- package/dist/@types/props.d.ts +3 -0
- package/dist/@types/props.js +1 -0
- package/dist/components/accordion/accordion.svelte +1 -1
- package/dist/components/accordion/accordion.types.d.ts +1 -1
- package/dist/components/accordion/modules/accordion-item.svelte +1 -1
- package/dist/components/alert/alert.svelte +1 -1
- package/dist/components/alert/alert.types.d.ts +1 -1
- package/dist/components/appbar/appbar.svelte +1 -1
- package/dist/components/appbar/appbar.types.d.ts +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.svelte +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +1 -1
- package/dist/components/avatar/avatar.svelte +1 -1
- package/dist/components/avatar/avatar.types.d.ts +1 -1
- package/dist/components/btn/btn.svelte +1 -1
- package/dist/components/btn/btn.types.d.ts +1 -1
- package/dist/components/card/card.svelte +1 -1
- package/dist/components/card/card.types.d.ts +1 -1
- package/dist/components/chip/chip.svelte +1 -1
- package/dist/components/chip/chip.types.d.ts +1 -1
- package/dist/components/dialog/dialog.svelte +1 -1
- package/dist/components/dialog/dialog.types.d.ts +1 -1
- package/dist/components/dropdown/dropdown.svelte +1 -1
- package/dist/components/dropdown/dropdown.types.d.ts +1 -1
- package/dist/components/icon/icon.svelte +1 -1
- package/dist/components/icon/icon.types.d.ts +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/list/list.svelte +1 -1
- package/dist/components/list/list.types.d.ts +1 -1
- package/dist/components/list/modules/list-item.svelte +1 -1
- package/dist/components/modal/modal.svelte +1 -1
- package/dist/components/modal/modal.types.d.ts +1 -1
- package/dist/components/popover/popover.svelte +1 -1
- package/dist/components/popover/popover.types.d.ts +1 -1
- package/dist/components/separator/separator.svelte +1 -1
- package/dist/components/separator/separator.types.d.ts +1 -1
- package/dist/components/spacer/spacer.svelte +1 -1
- package/dist/components/spacer/spacer.types.d.ts +1 -1
- package/dist/components/textfield/textfield.svelte +1 -1
- package/dist/components/textfield/textfield.types.d.ts +1 -1
- package/dist/components/toolbar/toolbar.svelte +1 -1
- package/dist/components/toolbar/toolbar.types.d.ts +1 -1
- package/dist/components/tooltip/tooltip.svelte +1 -1
- package/dist/components/tooltip/tooltip.types.d.ts +1 -1
- package/dist/constants.d.ts +10 -0
- package/dist/{compiler/components.js → constants.js} +10 -3
- package/dist/entry-bundler.d.ts +3 -9
- package/dist/entry-bundler.js +1 -1
- package/dist/{compiler/preprocess/decode-sourcemap.d.ts → escaping.d.ts} +1 -1
- package/dist/{compiler/preprocess/decode-sourcemap.js → escaping.js} +49 -1
- package/dist/framework.d.ts +15 -0
- package/dist/{compiler/preprocess/lili.js → framework.js} +14 -6
- package/dist/{compiler/mapped-code.d.ts → html-mapped.d.ts} +1 -2
- package/dist/labs/index.d.ts +1 -0
- package/dist/labs/index.js +2 -0
- package/dist/{components → labs}/sheet/sheet.svelte +1 -1
- package/dist/utils/components.d.ts +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +2 -2
- package/dist/utils/outside.d.ts +1 -1
- package/package.json +6 -1
- package/dist/compiler/components.d.ts +0 -2
- package/dist/compiler/index.d.ts +0 -1
- package/dist/compiler/index.js +0 -1
- package/dist/compiler/plugins.d.ts +0 -7
- package/dist/compiler/plugins.js +0 -7
- package/dist/compiler/preprocess/finding.d.ts +0 -1
- package/dist/compiler/preprocess/finding.js +0 -49
- package/dist/compiler/preprocess/index.d.ts +0 -1
- package/dist/compiler/preprocess/index.js +0 -1
- package/dist/compiler/preprocess/lili.d.ts +0 -9
- package/dist/compiler/preprocess/source-import.d.ts +0 -7
- package/dist/compiler/preprocess/source-import.js +0 -9
- package/dist/compiler/types/dom.d.ts +0 -2
- package/dist/compiler/types/index.d.ts +0 -2
- package/dist/compiler/types/index.js +0 -1
- package/dist/compiler/types/options.d.ts +0 -12
- package/dist/utils/types/index.d.ts +0 -44
- /package/dist/{compiler/types/dom.js → @types/animations.js} +0 -0
- /package/dist/{compiler/types/options.js → @types/components.js} +0 -0
- /package/dist/{utils/types/index.js → @types/core.js} +0 -0
- /package/dist/{compiler/mapped-code.js → html-mapped.js} +0 -0
- /package/dist/{components → labs}/sheet/sheet.svelte.d.ts +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ClassNameType, IdElementType, KitClassNameType, KitStylePropertiesType, PropValue, SClassProp, SStyleProp, StylePropertiesType } from './';
|
|
3
|
+
export interface useClassNameProps {
|
|
4
|
+
baseClass?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
sClass?: SClassProp;
|
|
7
|
+
classProps?: Record<string, PropValue>;
|
|
8
|
+
}
|
|
9
|
+
export interface useStylesProps {
|
|
10
|
+
styleAttr?: string;
|
|
11
|
+
sStyle?: SStyleProp;
|
|
12
|
+
styleProps?: Record<string, PropValue>;
|
|
13
|
+
}
|
|
14
|
+
export interface Base {
|
|
15
|
+
id?: IdElementType;
|
|
16
|
+
class?: ClassNameType;
|
|
17
|
+
style?: StylePropertiesType;
|
|
18
|
+
's-class'?: KitClassNameType;
|
|
19
|
+
's-style'?: KitStylePropertiesType;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
export interface Component extends Base {
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
}
|
|
25
|
+
export type KitComponentScan = {
|
|
26
|
+
code: string;
|
|
27
|
+
changed: boolean;
|
|
28
|
+
importedComponents: Map<string, string>;
|
|
29
|
+
};
|
|
30
|
+
export type ComponentInfo = {
|
|
31
|
+
name: string;
|
|
32
|
+
ref: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type IdElementType = string | undefined;
|
|
2
|
+
export type ClassNameType = string | string[] | undefined;
|
|
3
|
+
export type StylePropertiesType = string | undefined;
|
|
4
|
+
export type KitClassNameType = string | string[] | undefined;
|
|
5
|
+
export type KitStylePropertiesType = Record<string, boolean | string> | undefined;
|
|
6
|
+
export type SClassProp = string | string[] | Record<string, boolean | string> | undefined;
|
|
7
|
+
export type SStyleProp = Record<string, boolean | string> | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import type { AccordionProps } from './accordion.types.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../../
|
|
3
|
+
import { makeComponentProps } from '../../../html-mapped';
|
|
4
4
|
import type { AccordionItemModelProps, AccordionItemProps } from '../accordion.types.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import type { AlertDensity, AlertProps, AlertTone, AlertVariant } from './alert.types.js';
|
|
5
5
|
|
|
6
6
|
function resolveVariant(value: AlertVariant | undefined): AlertVariant {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { Component, RoundedType } from '
|
|
2
|
+
import type { Component, RoundedType } from '../../@types';
|
|
3
3
|
export type AlertVariant = 'filled' | 'outline' | 'text';
|
|
4
4
|
export type AlertDensity = 'compact' | 'comfortable' | 'default';
|
|
5
5
|
export type AlertTone = 'default' | 'info' | 'success' | 'warning' | 'error';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import type { AspectRatioFit, AspectRatioProps, AspectRatioValue } from './aspect-ratio.types.js';
|
|
5
5
|
|
|
6
6
|
const FALLBACK_RATIO = 16 / 9;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component } from '
|
|
1
|
+
import type { Component } from '../../@types';
|
|
2
2
|
export type AvatarSize = 'default' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
3
|
export type AvatarDensity = 'compact' | 'comfortable' | 'default';
|
|
4
4
|
export interface AvatarProps extends Component {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import { ripple } from '../../animations';
|
|
5
5
|
import type { ButtonProps } from './btn.types.js';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import { ripple } from '../../animations';
|
|
5
5
|
import type { CardProps } from './card.types.js';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import { ripple } from '../../animations';
|
|
5
5
|
import type { ChipProps } from './chip.types.js';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { disabledScroll } from '../../@legacy/internal/helpers/scroll';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import { useClassName, useStyles } from '../../utils';
|
|
5
5
|
import type { DialogDensity, DialogPosition, DialogProps, DialogSize } from './dialog.types.js';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, RoundedType } from '
|
|
1
|
+
import type { Component, RoundedType } from '../../@types';
|
|
2
2
|
export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
3
|
export type DialogPosition = 'top' | 'center' | 'bottom';
|
|
4
4
|
export type DialogDensity = 'compact' | 'comfortable' | 'default';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onDestroy } from 'svelte';
|
|
3
3
|
import { useClassName, useStyles, clickOutside } from '../../utils';
|
|
4
|
-
import { makeComponentProps } from '../../
|
|
4
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
5
5
|
import { getPositions } from './dropdown.svelte.js';
|
|
6
6
|
import type { DropdownProps, ModelDropdownProps } from './dropdown.types.js';
|
|
7
7
|
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { makeComponentProps } from '../../
|
|
2
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
3
3
|
import { useClassName, useStyles } from '../../utils';
|
|
4
4
|
import type { ListDensity, ListProps, ListVariant } from './list.types.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { Component, RoundedType, SizeType } from '
|
|
2
|
+
import type { Component, RoundedType, SizeType } from '../../@types';
|
|
3
3
|
export type ListVariant = 'filled' | 'outline' | 'text';
|
|
4
4
|
export type ListDensity = 'compact' | 'comfortable' | 'default';
|
|
5
5
|
export type ListElement = 'div' | 'nav' | 'ul';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ripple } from '../../../animations';
|
|
3
|
-
import { makeComponentProps } from '../../../
|
|
3
|
+
import { makeComponentProps } from '../../../html-mapped';
|
|
4
4
|
import { useClassName, useStyles } from '../../../utils';
|
|
5
5
|
import type { ListItemProps } from '../list.types.js';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onDestroy } from 'svelte';
|
|
3
3
|
import { get } from 'svelte/store';
|
|
4
|
-
import { makeComponentProps } from '../../
|
|
4
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
5
5
|
import { useClassName, useStyles } from '../../utils';
|
|
6
6
|
import { modalOpen, modalStack, popModal, pushModal, setOpenModal } from '../../@legacy/stores';
|
|
7
7
|
import type { ModalDensity, ModalPosition, ModalProps, ModalSize } from './modal.types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, RoundedType } from '
|
|
1
|
+
import type { Component, RoundedType } from '../../@types';
|
|
2
2
|
export type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
3
3
|
export type ModalPosition = 'top' | 'center' | 'bottom';
|
|
4
4
|
export type ModalDensity = 'compact' | 'comfortable' | 'default';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles, clickOutside } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import { getPositions } from './popover.svelte.js';
|
|
5
5
|
import type { ModelPopoverProps, PopoverProps } from './popover.types.js';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import type { SeparatorProps } from './separator.types.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import Icon from '../icon/icon.svelte';
|
|
5
5
|
import type { TextfieldProps } from './textfield.types.js';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, RoundedType, SizeType } from '
|
|
1
|
+
import type { Component, RoundedType, SizeType } from '../../@types';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
4
4
|
export interface TextfieldProps extends Component {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useClassName, useStyles } from '../../utils/index';
|
|
3
|
-
import { makeComponentProps } from '../../
|
|
3
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import type { ToolbarProps } from './toolbar.types.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, PropValue, RoundedType } from '
|
|
1
|
+
import type { Component, PropValue, RoundedType } from '../../@types';
|
|
2
2
|
type Variant = 'outline' | 'text' | 'dash';
|
|
3
3
|
type Density = 'compact' | 'comfortable' | 'default';
|
|
4
4
|
type Orientation = 'horizontal' | 'vertical';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onDestroy } from 'svelte';
|
|
3
3
|
import { useClassName, useStyles } from '../../utils';
|
|
4
|
-
import { makeComponentProps } from '../../
|
|
4
|
+
import { makeComponentProps } from '../../html-mapped';
|
|
5
5
|
import { getPositionsTooltip } from './tooltip.svelte.js';
|
|
6
6
|
import type { TooltipProps } from './tooltip.types.js';
|
|
7
7
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const lapikitImportsRef = "lapikit/labs/components";
|
|
2
|
+
export declare const lapikitImportsLabsRef = "lapikit/labs/labs/components";
|
|
3
|
+
export declare const lapikitComponents: readonly string[];
|
|
4
|
+
export declare const lapikitLabsComponents: readonly string[];
|
|
5
|
+
export declare const lapikitPlugins: {
|
|
6
|
+
readonly repl: {
|
|
7
|
+
readonly components: readonly ["repl"];
|
|
8
|
+
readonly ref: "@lapikit/repl";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
export const lapikitImportsRef = 'lapikit/labs/components';
|
|
2
|
+
export const lapikitImportsLabsRef = 'lapikit/labs/labs/components';
|
|
3
|
+
export const lapikitComponents = [
|
|
3
4
|
'app',
|
|
4
5
|
'btn',
|
|
5
6
|
'icon',
|
|
@@ -29,4 +30,10 @@ const lapikitComponents = [
|
|
|
29
30
|
'chip',
|
|
30
31
|
'card'
|
|
31
32
|
];
|
|
32
|
-
export
|
|
33
|
+
export const lapikitLabsComponents = ['sheet'];
|
|
34
|
+
export const lapikitPlugins = {
|
|
35
|
+
repl: {
|
|
36
|
+
components: ['repl'],
|
|
37
|
+
ref: '@lapikit/repl'
|
|
38
|
+
}
|
|
39
|
+
};
|
package/dist/entry-bundler.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type { LapikitPreprocessOptions } from '
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
content: string;
|
|
5
|
-
filename?: string;
|
|
6
|
-
}): {
|
|
7
|
-
code: string;
|
|
8
|
-
} | undefined;
|
|
9
|
-
};
|
|
1
|
+
import type { LapikitPreprocessOptions } from './@types/index.js';
|
|
2
|
+
import type { PreprocessorGroup } from 'svelte/compiler';
|
|
3
|
+
declare function lapikitPreprocess(options?: LapikitPreprocessOptions): PreprocessorGroup;
|
|
10
4
|
export { lapikitPreprocess };
|
package/dist/entry-bundler.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo, KitComponentScan } from '
|
|
1
|
+
import type { ComponentInfo, KitComponentScan } from './@types/index.js';
|
|
2
2
|
export declare const decodeSourceMap: (content: string, componentInfo: Map<string, ComponentInfo>) => KitComponentScan;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { findTagEnd } from './finding';
|
|
2
1
|
export const decodeSourceMap = (content, componentInfo) => {
|
|
3
2
|
const importedComponents = new Map();
|
|
4
3
|
const parts = [];
|
|
@@ -104,3 +103,52 @@ export const decodeSourceMap = (content, componentInfo) => {
|
|
|
104
103
|
importedComponents
|
|
105
104
|
};
|
|
106
105
|
};
|
|
106
|
+
const findTagEnd = (content, start) => {
|
|
107
|
+
let inSingle = false;
|
|
108
|
+
let inDouble = false;
|
|
109
|
+
let inTemplate = false;
|
|
110
|
+
let braceDepth = 0;
|
|
111
|
+
for (let i = start; i < content.length; i++) {
|
|
112
|
+
const ch = content[i];
|
|
113
|
+
const prev = i > 0 ? content[i - 1] : '';
|
|
114
|
+
if (inSingle) {
|
|
115
|
+
if (ch === "'" && prev !== '\\')
|
|
116
|
+
inSingle = false;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (inDouble) {
|
|
120
|
+
if (ch === '"' && prev !== '\\')
|
|
121
|
+
inDouble = false;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (inTemplate) {
|
|
125
|
+
if (ch === '`' && prev !== '\\')
|
|
126
|
+
inTemplate = false;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (ch === "'") {
|
|
130
|
+
inSingle = true;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (ch === '"') {
|
|
134
|
+
inDouble = true;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (ch === '`') {
|
|
138
|
+
inTemplate = true;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (ch === '{') {
|
|
142
|
+
braceDepth++;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (ch === '}' && braceDepth > 0) {
|
|
146
|
+
braceDepth--;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (braceDepth === 0 && ch === '>') {
|
|
150
|
+
return i;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return -1;
|
|
154
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LapikitPreprocessOptions } from './@types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* componentName generates the component name used in imports
|
|
4
|
+
* @param shortName The short name of the component
|
|
5
|
+
* @returns The component name with "Kit" prefix and the first letter capitalized
|
|
6
|
+
*/
|
|
7
|
+
export declare function componentName(shortName: string): string;
|
|
8
|
+
export declare function liliCore(options?: LapikitPreprocessOptions): {
|
|
9
|
+
markup({ content }: {
|
|
10
|
+
content: string;
|
|
11
|
+
filename?: string;
|
|
12
|
+
}): {
|
|
13
|
+
code: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
};
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { decodeSourceMap } from './escaping.js';
|
|
2
|
+
import { lapikitImportsRef, lapikitImportsLabsRef, lapikitComponents, lapikitLabsComponents, lapikitPlugins } from './constants.js';
|
|
3
|
+
/**
|
|
4
|
+
* componentName generates the component name used in imports
|
|
5
|
+
* @param shortName The short name of the component
|
|
6
|
+
* @returns The component name with "Kit" prefix and the first letter capitalized
|
|
7
|
+
*/
|
|
8
|
+
export function componentName(shortName) {
|
|
9
|
+
return 'Kit' + shortName.charAt(0).toUpperCase() + shortName.slice(1);
|
|
10
|
+
}
|
|
6
11
|
export function liliCore(options) {
|
|
7
12
|
return {
|
|
8
13
|
markup({ content }) {
|
|
9
|
-
const allComponents = [...lapikitComponents];
|
|
14
|
+
const allComponents = [...lapikitComponents, ...lapikitLabsComponents];
|
|
10
15
|
const componentToRef = new Map();
|
|
11
16
|
lapikitComponents.forEach((comp) => {
|
|
12
17
|
componentToRef.set(comp, lapikitImportsRef);
|
|
13
18
|
});
|
|
19
|
+
lapikitLabsComponents.forEach((comp) => {
|
|
20
|
+
componentToRef.set(comp, lapikitImportsLabsRef);
|
|
21
|
+
});
|
|
14
22
|
// plugins
|
|
15
23
|
if (options?.plugins) {
|
|
16
24
|
options.plugins.forEach((pluginKey) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { SClassProp, SStyleProp } from '
|
|
2
|
-
import type { PropValue } from '../utils/types';
|
|
1
|
+
import type { PropValue, SClassProp, SStyleProp } from './@types';
|
|
3
2
|
/**
|
|
4
3
|
* Computes a string of class names based on the provided sClass and classDirectiveProps.
|
|
5
4
|
* @param sClass - The s-class property which can be a string, array, or object.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as KitSheet } from './sheet/sheet.svelte';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './outside';
|
|
1
|
+
export * from './components.js';
|
|
2
|
+
export * from './outside.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './outside';
|
|
1
|
+
export * from './components.js';
|
|
2
|
+
export * from './outside.js';
|
package/dist/utils/outside.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lapikit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -76,11 +76,16 @@
|
|
|
76
76
|
"default": "./dist/@legacy/themes.css"
|
|
77
77
|
},
|
|
78
78
|
"./labs/preprocess": {
|
|
79
|
+
"types": "./dist/entry-bundler.d.ts",
|
|
79
80
|
"default": "./dist/entry-bundler.js"
|
|
80
81
|
},
|
|
81
82
|
"./labs/components": {
|
|
82
83
|
"svelte": "./dist/components/index.js",
|
|
83
84
|
"default": "./dist/components/index.js"
|
|
85
|
+
},
|
|
86
|
+
"./labs/labs/components": {
|
|
87
|
+
"svelte": "./dist/labs/index.js",
|
|
88
|
+
"default": "./dist/labs/index.js"
|
|
84
89
|
}
|
|
85
90
|
},
|
|
86
91
|
"peerDependencies": {
|
package/dist/compiler/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './preprocess';
|
package/dist/compiler/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './preprocess';
|
package/dist/compiler/plugins.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const findTagEnd: (content: string, start: number) => number;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export const findTagEnd = (content, start) => {
|
|
2
|
-
let inSingle = false;
|
|
3
|
-
let inDouble = false;
|
|
4
|
-
let inTemplate = false;
|
|
5
|
-
let braceDepth = 0;
|
|
6
|
-
for (let i = start; i < content.length; i++) {
|
|
7
|
-
const ch = content[i];
|
|
8
|
-
const prev = i > 0 ? content[i - 1] : '';
|
|
9
|
-
if (inSingle) {
|
|
10
|
-
if (ch === "'" && prev !== '\\')
|
|
11
|
-
inSingle = false;
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
14
|
-
if (inDouble) {
|
|
15
|
-
if (ch === '"' && prev !== '\\')
|
|
16
|
-
inDouble = false;
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
if (inTemplate) {
|
|
20
|
-
if (ch === '`' && prev !== '\\')
|
|
21
|
-
inTemplate = false;
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
if (ch === "'") {
|
|
25
|
-
inSingle = true;
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
if (ch === '"') {
|
|
29
|
-
inDouble = true;
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (ch === '`') {
|
|
33
|
-
inTemplate = true;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (ch === '{') {
|
|
37
|
-
braceDepth++;
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
if (ch === '}' && braceDepth > 0) {
|
|
41
|
-
braceDepth--;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (braceDepth === 0 && ch === '>') {
|
|
45
|
-
return i;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return -1;
|
|
49
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './lili';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './lili';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* componentName generates the component name used in imports
|
|
3
|
-
* @param shortName The short name of the component
|
|
4
|
-
* @returns The component name with "Kit" prefix and the first letter capitalized
|
|
5
|
-
*/
|
|
6
|
-
export declare function componentName(shortName: string): string;
|
|
7
|
-
export declare const lapikitImportsRef = "lapikit/components";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* componentName generates the component name used in imports
|
|
3
|
-
* @param shortName The short name of the component
|
|
4
|
-
* @returns The component name with "Kit" prefix and the first letter capitalized
|
|
5
|
-
*/
|
|
6
|
-
export function componentName(shortName) {
|
|
7
|
-
return 'Kit' + shortName.charAt(0).toUpperCase() + shortName.slice(1);
|
|
8
|
-
}
|
|
9
|
-
export const lapikitImportsRef = 'lapikit/components';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './options';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type LapikitPreprocessOptions = {
|
|
2
|
-
plugins?: string[];
|
|
3
|
-
};
|
|
4
|
-
export type KitComponentScan = {
|
|
5
|
-
code: string;
|
|
6
|
-
changed: boolean;
|
|
7
|
-
importedComponents: Map<string, string>;
|
|
8
|
-
};
|
|
9
|
-
export type ComponentInfo = {
|
|
10
|
-
name: string;
|
|
11
|
-
ref: string;
|
|
12
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { SClassProp, SStyleProp } from '../../compiler/types';
|
|
3
|
-
type IdElementType = string | undefined;
|
|
4
|
-
type ClassNameType = string | string[] | undefined;
|
|
5
|
-
type KitClassNameType = string | string[] | undefined;
|
|
6
|
-
type KitStylePropertiesType = Record<string, boolean | string> | undefined;
|
|
7
|
-
type StylePropertiesType = string | undefined;
|
|
8
|
-
export type PropValue = string | boolean | number | null | undefined;
|
|
9
|
-
export type SizeType = 'default' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
|
-
export type RoundedType = 0 | '0' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
11
|
-
export interface useClassNameProps {
|
|
12
|
-
baseClass?: string;
|
|
13
|
-
className?: string;
|
|
14
|
-
sClass?: SClassProp;
|
|
15
|
-
classProps?: Record<string, PropValue>;
|
|
16
|
-
}
|
|
17
|
-
export interface useStylesProps {
|
|
18
|
-
styleAttr?: string;
|
|
19
|
-
sStyle?: SStyleProp;
|
|
20
|
-
styleProps?: Record<string, PropValue>;
|
|
21
|
-
}
|
|
22
|
-
export interface Base {
|
|
23
|
-
id?: IdElementType;
|
|
24
|
-
class?: ClassNameType;
|
|
25
|
-
style?: StylePropertiesType;
|
|
26
|
-
's-class'?: KitClassNameType;
|
|
27
|
-
's-style'?: KitStylePropertiesType;
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}
|
|
30
|
-
export interface Component extends Base {
|
|
31
|
-
children?: Snippet;
|
|
32
|
-
}
|
|
33
|
-
export interface RippleProps {
|
|
34
|
-
component?: string;
|
|
35
|
-
center?: boolean;
|
|
36
|
-
color?: string;
|
|
37
|
-
duration?: number;
|
|
38
|
-
disabled?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export type ClickOutsideOptions = {
|
|
41
|
-
exclude?: (HTMLElement | PointerEvent | null)[];
|
|
42
|
-
onClose: () => void;
|
|
43
|
-
};
|
|
44
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|