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.
Files changed (92) hide show
  1. package/dist/@types/animations.d.ts +7 -0
  2. package/dist/@types/components.d.ts +33 -0
  3. package/dist/@types/core.d.ts +3 -0
  4. package/dist/@types/dom.d.ts +7 -0
  5. package/dist/@types/dom.js +1 -0
  6. package/dist/@types/events.d.ts +4 -0
  7. package/dist/@types/events.js +1 -0
  8. package/dist/@types/index.d.ts +6 -0
  9. package/dist/@types/index.js +6 -0
  10. package/dist/@types/props.d.ts +3 -0
  11. package/dist/@types/props.js +1 -0
  12. package/dist/components/accordion/accordion.svelte +1 -1
  13. package/dist/components/accordion/accordion.types.d.ts +1 -1
  14. package/dist/components/accordion/modules/accordion-item.svelte +1 -1
  15. package/dist/components/alert/alert.svelte +1 -1
  16. package/dist/components/alert/alert.types.d.ts +1 -1
  17. package/dist/components/appbar/appbar.svelte +1 -1
  18. package/dist/components/appbar/appbar.types.d.ts +1 -1
  19. package/dist/components/aspect-ratio/aspect-ratio.svelte +1 -1
  20. package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +1 -1
  21. package/dist/components/avatar/avatar.svelte +1 -1
  22. package/dist/components/avatar/avatar.types.d.ts +1 -1
  23. package/dist/components/btn/btn.svelte +1 -1
  24. package/dist/components/btn/btn.types.d.ts +1 -1
  25. package/dist/components/card/card.svelte +1 -1
  26. package/dist/components/card/card.types.d.ts +1 -1
  27. package/dist/components/chip/chip.svelte +1 -1
  28. package/dist/components/chip/chip.types.d.ts +1 -1
  29. package/dist/components/dialog/dialog.svelte +1 -1
  30. package/dist/components/dialog/dialog.types.d.ts +1 -1
  31. package/dist/components/dropdown/dropdown.svelte +1 -1
  32. package/dist/components/dropdown/dropdown.types.d.ts +1 -1
  33. package/dist/components/icon/icon.svelte +1 -1
  34. package/dist/components/icon/icon.types.d.ts +1 -1
  35. package/dist/components/index.d.ts +0 -1
  36. package/dist/components/index.js +0 -1
  37. package/dist/components/list/list.svelte +1 -1
  38. package/dist/components/list/list.types.d.ts +1 -1
  39. package/dist/components/list/modules/list-item.svelte +1 -1
  40. package/dist/components/modal/modal.svelte +1 -1
  41. package/dist/components/modal/modal.types.d.ts +1 -1
  42. package/dist/components/popover/popover.svelte +1 -1
  43. package/dist/components/popover/popover.types.d.ts +1 -1
  44. package/dist/components/separator/separator.svelte +1 -1
  45. package/dist/components/separator/separator.types.d.ts +1 -1
  46. package/dist/components/spacer/spacer.svelte +1 -1
  47. package/dist/components/spacer/spacer.types.d.ts +1 -1
  48. package/dist/components/textfield/textfield.svelte +1 -1
  49. package/dist/components/textfield/textfield.types.d.ts +1 -1
  50. package/dist/components/toolbar/toolbar.svelte +1 -1
  51. package/dist/components/toolbar/toolbar.types.d.ts +1 -1
  52. package/dist/components/tooltip/tooltip.svelte +1 -1
  53. package/dist/components/tooltip/tooltip.types.d.ts +1 -1
  54. package/dist/constants.d.ts +10 -0
  55. package/dist/{compiler/components.js → constants.js} +10 -3
  56. package/dist/entry-bundler.d.ts +3 -9
  57. package/dist/entry-bundler.js +1 -1
  58. package/dist/{compiler/preprocess/decode-sourcemap.d.ts → escaping.d.ts} +1 -1
  59. package/dist/{compiler/preprocess/decode-sourcemap.js → escaping.js} +49 -1
  60. package/dist/framework.d.ts +15 -0
  61. package/dist/{compiler/preprocess/lili.js → framework.js} +14 -6
  62. package/dist/{compiler/mapped-code.d.ts → html-mapped.d.ts} +1 -2
  63. package/dist/labs/index.d.ts +1 -0
  64. package/dist/labs/index.js +2 -0
  65. package/dist/{components → labs}/sheet/sheet.svelte +1 -1
  66. package/dist/utils/components.d.ts +1 -1
  67. package/dist/utils/index.d.ts +2 -2
  68. package/dist/utils/index.js +2 -2
  69. package/dist/utils/outside.d.ts +1 -1
  70. package/package.json +6 -1
  71. package/dist/compiler/components.d.ts +0 -2
  72. package/dist/compiler/index.d.ts +0 -1
  73. package/dist/compiler/index.js +0 -1
  74. package/dist/compiler/plugins.d.ts +0 -7
  75. package/dist/compiler/plugins.js +0 -7
  76. package/dist/compiler/preprocess/finding.d.ts +0 -1
  77. package/dist/compiler/preprocess/finding.js +0 -49
  78. package/dist/compiler/preprocess/index.d.ts +0 -1
  79. package/dist/compiler/preprocess/index.js +0 -1
  80. package/dist/compiler/preprocess/lili.d.ts +0 -9
  81. package/dist/compiler/preprocess/source-import.d.ts +0 -7
  82. package/dist/compiler/preprocess/source-import.js +0 -9
  83. package/dist/compiler/types/dom.d.ts +0 -2
  84. package/dist/compiler/types/index.d.ts +0 -2
  85. package/dist/compiler/types/index.js +0 -1
  86. package/dist/compiler/types/options.d.ts +0 -12
  87. package/dist/utils/types/index.d.ts +0 -44
  88. /package/dist/{compiler/types/dom.js → @types/animations.js} +0 -0
  89. /package/dist/{compiler/types/options.js → @types/components.js} +0 -0
  90. /package/dist/{utils/types/index.js → @types/core.js} +0 -0
  91. /package/dist/{compiler/mapped-code.js → html-mapped.js} +0 -0
  92. /package/dist/{components → labs}/sheet/sheet.svelte.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ export interface RippleProps {
2
+ component?: string;
3
+ center?: boolean;
4
+ color?: string;
5
+ duration?: number;
6
+ disabled?: boolean;
7
+ }
@@ -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,3 @@
1
+ export type LapikitPreprocessOptions = {
2
+ plugins?: string[];
3
+ };
@@ -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,4 @@
1
+ export type ClickOutsideOptions = {
2
+ exclude?: (HTMLElement | PointerEvent | null)[];
3
+ onClose: () => void;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from './dom.js';
2
+ export * from './components.js';
3
+ export * from './props.js';
4
+ export * from './events.js';
5
+ export * from './animations.js';
6
+ export * from './core.js';
@@ -0,0 +1,6 @@
1
+ export * from './dom.js';
2
+ export * from './components.js';
3
+ export * from './props.js';
4
+ export * from './events.js';
5
+ export * from './animations.js';
6
+ export * from './core.js';
@@ -0,0 +1,3 @@
1
+ export type PropValue = string | boolean | number | null | undefined;
2
+ export type SizeType = 'default' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
+ export type RoundedType = 0 | '0' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -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 '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import type { AccordionProps } from './accordion.types.js';
5
5
 
6
6
  let {
@@ -1,4 +1,4 @@
1
- import type { RoundedType, Component } from '../../utils/types';
1
+ import type { RoundedType, Component } from '../../@types';
2
2
  import type { Snippet } from 'svelte';
3
3
  export interface AccordionProps extends Component {
4
4
  ref?: HTMLElement | null;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../../utils';
3
- import { makeComponentProps } from '../../../compiler/mapped-code';
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 '../../compiler/mapped-code';
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 '../../utils/types';
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 '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import type { AppbarProps } from './appbar.types.js';
5
5
 
6
6
  let {
@@ -1,4 +1,4 @@
1
- import type { Component, RoundedType } from '../../utils/types';
1
+ import type { Component, RoundedType } from '../../@types';
2
2
  type Density = 'compact' | 'comfortable' | 'default';
3
3
  type Variant = 'outline' | 'text';
4
4
  export interface AppbarProps extends Component {
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../utils';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
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 '../../utils/types';
1
+ import type { Component } from '../../@types';
2
2
  export type AspectRatioValue = string | number;
3
3
  export type AspectRatioFit = 'cover' | 'contain' | 'fill';
4
4
  export interface AspectRatioProps extends Component {
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../utils';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import type { AvatarProps } from './avatar.types.js';
5
5
 
6
6
  let {
@@ -1,4 +1,4 @@
1
- import type { Component } from '../../utils/types';
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 '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import { ripple } from '../../animations';
5
5
  import type { ButtonProps } from './btn.types.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import type { Component, RoundedType, SizeType } from '../../utils/types';
1
+ import type { Component, RoundedType, SizeType } from '../../@types';
2
2
  import type { Snippet } from 'svelte';
3
3
  export interface ButtonProps extends Component {
4
4
  ref?: HTMLElement | null;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../utils';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import { ripple } from '../../animations';
5
5
  import type { CardProps } from './card.types.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import type { Component, RoundedType } from '../../utils/types';
1
+ import type { Component, RoundedType } from '../../@types';
2
2
  export interface CardProps extends Component {
3
3
  ref?: HTMLElement | null;
4
4
  is?: 'div' | 'article' | 'section' | 'aside' | 'a' | 'button';
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../utils';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import { ripple } from '../../animations';
5
5
  import type { ChipProps } from './chip.types.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import type { Component, SizeType } from '../../utils/types';
1
+ import type { Component, SizeType } from '../../@types';
2
2
  import type { Snippet } from 'svelte';
3
3
  export interface ChipProps extends Component {
4
4
  ref?: HTMLElement | null;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { disabledScroll } from '../../@legacy/internal/helpers/scroll';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
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 '../../utils/types';
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 '../../compiler/mapped-code';
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
 
@@ -1,4 +1,4 @@
1
- import type { Component, PropValue, RoundedType } from '../../utils/types/index';
1
+ import type { Component, PropValue, RoundedType } from '../../@types/index';
2
2
  import type { Snippet } from 'svelte';
3
3
  export type PositionElement = {
4
4
  x: number;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../utils';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import type { IconProps } from './icon.types.js';
5
5
 
6
6
  let {
@@ -1,4 +1,4 @@
1
- import type { Component, SizeType } from '../../utils/types';
1
+ import type { Component, SizeType } from '../../@types';
2
2
  export interface IconProps extends Component {
3
3
  ref?: HTMLElement | null;
4
4
  name?: string;
@@ -1,4 +1,3 @@
1
- export { default as KitSheet } from './sheet/sheet.svelte';
2
1
  export { default as KitApp } from './app/app.svelte';
3
2
  export { default as KitAppbar } from './appbar/appbar.svelte';
4
3
  export { default as KitBtn } from './btn/btn.svelte';
@@ -1,5 +1,4 @@
1
1
  // components
2
- export { default as KitSheet } from './sheet/sheet.svelte';
3
2
  export { default as KitApp } from './app/app.svelte';
4
3
  export { default as KitAppbar } from './appbar/appbar.svelte';
5
4
  export { default as KitBtn } from './btn/btn.svelte';
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { makeComponentProps } from '../../compiler/mapped-code';
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 '../../utils/types';
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 '../../../compiler/mapped-code';
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 '../../compiler/mapped-code';
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 '../../utils/types';
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 '../../compiler/mapped-code';
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,4 +1,4 @@
1
- import type { Component, PropValue, RoundedType } from '../../utils/types';
1
+ import type { Component, PropValue, RoundedType } from '../../@types';
2
2
  import type { Snippet } from 'svelte';
3
3
  export type PositionElement = {
4
4
  x: number;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../utils';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
3
+ import { makeComponentProps } from '../../html-mapped';
4
4
  import type { SeparatorProps } from './separator.types.js';
5
5
 
6
6
  let {
@@ -1,4 +1,4 @@
1
- import type { Base } from '../../utils/types';
1
+ import type { Base } from '../../@types';
2
2
  type Orientation = 'horizontal' | 'vertical';
3
3
  export interface SeparatorProps extends Base {
4
4
  ref?: HTMLElement | null;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { makeComponentProps } from '../../compiler/mapped-code';
2
+ import { makeComponentProps } from '../../html-mapped';
3
3
  import { useClassName, useStyles } from '../../utils';
4
4
  import type { SpacerProps } from './spacer.types.js';
5
5
 
@@ -1,4 +1,4 @@
1
- import type { Base } from '../../utils/types';
1
+ import type { Base } from '../../@types';
2
2
  export interface SpacerProps extends Base {
3
3
  is?: 'div';
4
4
  }
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { useClassName, useStyles } from '../../utils';
3
- import { makeComponentProps } from '../../compiler/mapped-code';
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 '../../utils/types';
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 '../../compiler/mapped-code';
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 '../../utils/types';
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 '../../compiler/mapped-code';
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
 
@@ -1,4 +1,4 @@
1
- import type { Component, PropValue, RoundedType } from '../../utils/types';
1
+ import type { Component, PropValue, RoundedType } from '../../@types';
2
2
  import type { Snippet } from 'svelte';
3
3
  export interface TooltipProps extends Component {
4
4
  ref?: HTMLElement | null;
@@ -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 lapikitComponents = [
2
- 'sheet',
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 default lapikitComponents;
33
+ export const lapikitLabsComponents = ['sheet'];
34
+ export const lapikitPlugins = {
35
+ repl: {
36
+ components: ['repl'],
37
+ ref: '@lapikit/repl'
38
+ }
39
+ };
@@ -1,10 +1,4 @@
1
- import type { LapikitPreprocessOptions } from './compiler/types/options';
2
- declare function lapikitPreprocess(options?: LapikitPreprocessOptions): {
3
- markup({ content }: {
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 };
@@ -1,4 +1,4 @@
1
- import { liliCore } from './compiler/preprocess';
1
+ import { liliCore } from './framework.js';
2
2
  function lapikitPreprocess(options) {
3
3
  return liliCore(options);
4
4
  }
@@ -1,2 +1,2 @@
1
- import type { ComponentInfo, KitComponentScan } from '../types';
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 { componentName, lapikitImportsRef } from './source-import';
2
- import { decodeSourceMap } from './decode-sourcemap';
3
- // imports components and plugins
4
- import lapikitComponents from '../components';
5
- import lapikitPlugins from '../plugins';
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 './types';
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';
@@ -0,0 +1,2 @@
1
+ // components labs
2
+ export { default as KitSheet } from './sheet/sheet.svelte';
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { useClassName, useStyles } from '../../utils';
8
- import { makeComponentProps } from '../../compiler/mapped-code';
8
+ import { makeComponentProps } from '../../html-mapped';
9
9
 
10
10
  let {
11
11
  class: className,
@@ -1,4 +1,4 @@
1
- import type { useClassNameProps, useStylesProps } from './types';
1
+ import type { useClassNameProps, useStylesProps } from '../@types';
2
2
  /**
3
3
  * useClassName - Utility to compute class names for a component.
4
4
  * @param baseClass - The base class name for the component.
@@ -1,2 +1,2 @@
1
- export * from './components';
2
- export * from './outside';
1
+ export * from './components.js';
2
+ export * from './outside.js';
@@ -1,2 +1,2 @@
1
- export * from './components';
2
- export * from './outside';
1
+ export * from './components.js';
2
+ export * from './outside.js';
@@ -1,4 +1,4 @@
1
- import type { ClickOutsideOptions } from './types';
1
+ import type { ClickOutsideOptions } from '../@types';
2
2
  export declare function clickOutside(node: HTMLElement, options: ClickOutsideOptions): {
3
3
  update(newOptions: ClickOutsideOptions): void;
4
4
  destroy(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapikit",
3
- "version": "0.4.14",
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": {
@@ -1,2 +0,0 @@
1
- declare const lapikitComponents: readonly string[];
2
- export default lapikitComponents;
@@ -1 +0,0 @@
1
- export * from './preprocess';
@@ -1 +0,0 @@
1
- export * from './preprocess';
@@ -1,7 +0,0 @@
1
- declare const lapikitPlugins: {
2
- readonly repl: {
3
- readonly components: readonly ["repl"];
4
- readonly ref: "@lapikit/repl";
5
- };
6
- };
7
- export default lapikitPlugins;
@@ -1,7 +0,0 @@
1
- const lapikitPlugins = {
2
- repl: {
3
- components: ['repl'],
4
- ref: '@lapikit/repl'
5
- }
6
- };
7
- export default lapikitPlugins;
@@ -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,9 +0,0 @@
1
- import type { LapikitPreprocessOptions } from '../types';
2
- export declare function liliCore(options?: LapikitPreprocessOptions): {
3
- markup({ content }: {
4
- content: string;
5
- filename?: string;
6
- }): {
7
- code: string;
8
- } | undefined;
9
- };
@@ -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,2 +0,0 @@
1
- export type SClassProp = string | string[] | Record<string, boolean | string> | undefined;
2
- export type SStyleProp = Record<string, boolean | string> | undefined;
@@ -1,2 +0,0 @@
1
- export type * from './dom';
2
- export * from './options';
@@ -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