@dryui/primitives 0.0.3 → 0.1.3

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.
@@ -203,15 +203,17 @@
203
203
  });
204
204
  </script>
205
205
 
206
- <div bind:this={containerEl} class={className} data-part="map-root" {...rest}>
207
- {#if error}
206
+ {#if error}
207
+ <div class={className} data-part="map-root" {...rest}>
208
208
  <div data-part="map-error" class="map-error">
209
209
  {error}
210
210
  </div>
211
+ </div>
212
+ {:else}
213
+ <div bind:this={containerEl} class={className} data-part="map-root" {...rest}></div>
214
+ {#if children}
215
+ {@render children()}
211
216
  {/if}
212
- </div>
213
- {#if children && !error}
214
- {@render children()}
215
217
  {/if}
216
218
 
217
219
  <style>
@@ -1,27 +1,28 @@
1
1
  export interface RichTextEditorContext {
2
- readonly isBold: boolean;
3
- readonly isItalic: boolean;
4
- readonly isUnderline: boolean;
5
- readonly isStrikethrough: boolean;
6
- readonly isOrderedList: boolean;
7
- readonly isUnorderedList: boolean;
8
- readonly currentHeading: string | null;
9
- readonly currentLink: string | null;
10
- readonly html: string;
11
- readonly readonly: boolean;
12
- contentEl: HTMLDivElement | null;
13
- execCommand: (command: string, value?: string) => void;
14
- toggleBold: () => void;
15
- toggleItalic: () => void;
16
- toggleUnderline: () => void;
17
- toggleStrikethrough: () => void;
18
- toggleOrderedList: () => void;
19
- toggleUnorderedList: () => void;
20
- setHeading: (level: 'h1' | 'h2' | 'h3' | 'p') => void;
21
- insertLink: (url: string) => void;
22
- removeLink: () => void;
23
- getContent: () => string;
24
- updateState: () => void;
2
+ readonly isBold: boolean;
3
+ readonly isItalic: boolean;
4
+ readonly isUnderline: boolean;
5
+ readonly isStrikethrough: boolean;
6
+ readonly isOrderedList: boolean;
7
+ readonly isUnorderedList: boolean;
8
+ readonly currentHeading: string | null;
9
+ readonly currentLink: string | null;
10
+ readonly html: string;
11
+ readonly readonly: boolean;
12
+ readonly placeholder: string;
13
+ contentEl: HTMLDivElement | null;
14
+ execCommand: (command: string, value?: string) => void;
15
+ toggleBold: () => void;
16
+ toggleItalic: () => void;
17
+ toggleUnderline: () => void;
18
+ toggleStrikethrough: () => void;
19
+ toggleOrderedList: () => void;
20
+ toggleUnorderedList: () => void;
21
+ setHeading: (level: 'h1' | 'h2' | 'h3' | 'p') => void;
22
+ insertLink: (url: string) => void;
23
+ removeLink: () => void;
24
+ getContent: () => string;
25
+ updateState: () => void;
26
+ syncValue: () => void;
25
27
  }
26
- export declare function setRichTextEditorCtx(ctx: RichTextEditorContext): RichTextEditorContext;
27
- export declare function getRichTextEditorCtx(): RichTextEditorContext;
28
+ export declare const setRichTextEditorCtx: (ctx: RichTextEditorContext) => RichTextEditorContext, getRichTextEditorCtx: () => RichTextEditorContext;
@@ -30,6 +30,8 @@ export interface RichTextEditorToolbarProps extends Omit<HTMLAttributes<HTMLDivE
30
30
  }
31
31
  export interface RichTextEditorContentProps extends HTMLAttributes<HTMLDivElement> {
32
32
  }
33
+ export { setRichTextEditorCtx, getRichTextEditorCtx } from './context.svelte.js';
34
+ export type { RichTextEditorContext } from './context.svelte.js';
33
35
  import RichTextEditorRoot from './rich-text-editor-root.svelte';
34
36
  import RichTextEditorToolbar from './rich-text-editor-toolbar.svelte';
35
37
  import RichTextEditorContent from './rich-text-editor-content.svelte';
@@ -38,4 +40,3 @@ export declare const RichTextEditor: {
38
40
  Toolbar: typeof RichTextEditorToolbar;
39
41
  Content: typeof RichTextEditorContent;
40
42
  };
41
- export {};
@@ -1,3 +1,4 @@
1
+ export { setRichTextEditorCtx, getRichTextEditorCtx } from './context.svelte.js';
1
2
  import RichTextEditorRoot from './rich-text-editor-root.svelte';
2
3
  import RichTextEditorToolbar from './rich-text-editor-toolbar.svelte';
3
4
  import RichTextEditorContent from './rich-text-editor-content.svelte';