@placeholderco/placeholder-ui 2.3.0 → 2.5.2
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/README.md +2 -7
- package/dist/app.css +1 -2
- package/dist/display/filetree/FileTree.svelte.d.ts +1 -1
- package/dist/editors/tiptap/TipTap.svelte +10 -1
- package/dist/editors/tiptap/TipTapBubble.svelte +10 -1
- package/dist/editors/tiptap/extensions/ClassAttribute.d.ts +16 -0
- package/dist/editors/tiptap/extensions/ClassAttribute.js +59 -0
- package/dist/editors/tiptap/extensions/index.d.ts +2 -0
- package/dist/editors/tiptap/extensions/index.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/layout/AppShell.svelte +1 -6
- package/dist/layout/AppShell.svelte.d.ts +1 -1
- package/dist/{bootstrap.min.css → styles.css} +56 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -19,8 +19,7 @@ Peer dependency: `svelte ^5`.
|
|
|
19
19
|
|
|
20
20
|
## Quick start
|
|
21
21
|
|
|
22
|
-
Wrap your app in `AppShell` (it loads the base stylesheet
|
|
23
|
-
Bootstrap 5), then use components:
|
|
22
|
+
Wrap your app in `AppShell` (it loads the base stylesheet), then use components:
|
|
24
23
|
|
|
25
24
|
```svelte
|
|
26
25
|
<script lang="ts">
|
|
@@ -33,15 +32,11 @@ Bootstrap 5), then use components:
|
|
|
33
32
|
</AppShell>
|
|
34
33
|
```
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
`AppShell` and import the token stylesheet yourself:
|
|
35
|
+
Or skip `AppShell` and import the token stylesheet yourself:
|
|
38
36
|
|
|
39
37
|
```ts
|
|
40
38
|
import '@placeholderco/placeholder-ui/app.css';
|
|
41
39
|
```
|
|
42
|
-
|
|
43
|
-
The bundled Bootstrap is also available on its own as `@placeholderco/placeholder-ui/bootstrap.css`.
|
|
44
|
-
|
|
45
40
|
## Branding
|
|
46
41
|
|
|
47
42
|
Everything colour- and font-related resolves to `--ui-*` custom properties, so
|
package/dist/app.css
CHANGED
|
@@ -115,8 +115,7 @@ body {
|
|
|
115
115
|
font-family: var(--ui-font-family);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
/* Form controls do not inherit fonts by default; make them follow the UI font
|
|
119
|
-
even when Bootstrap's reboot is not loaded. */
|
|
118
|
+
/* Form controls do not inherit fonts by default; make them follow the UI font */
|
|
120
119
|
button,
|
|
121
120
|
input,
|
|
122
121
|
select,
|
|
@@ -71,6 +71,6 @@ export interface FileTreeProps {
|
|
|
71
71
|
onChange?: (nodes: FileTreeNode[]) => void;
|
|
72
72
|
class?: string;
|
|
73
73
|
}
|
|
74
|
-
declare const FileTree: import("svelte").Component<FileTreeProps, {}, "
|
|
74
|
+
declare const FileTree: import("svelte").Component<FileTreeProps, {}, "nodes" | "selectedId">;
|
|
75
75
|
type FileTree = ReturnType<typeof FileTree>;
|
|
76
76
|
export default FileTree;
|
|
@@ -15,7 +15,14 @@
|
|
|
15
15
|
import { TextStyle } from '@tiptap/extension-text-style';
|
|
16
16
|
import Collaboration from '@tiptap/extension-collaboration';
|
|
17
17
|
import { CollaborationCaret } from '@tiptap/extension-collaboration-caret';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
Alert,
|
|
20
|
+
ClassAttribute,
|
|
21
|
+
CodeBlockEditor,
|
|
22
|
+
Div,
|
|
23
|
+
Span,
|
|
24
|
+
type CodeBlocksOptions
|
|
25
|
+
} from './extensions/index.js';
|
|
19
26
|
import type { CollaborationConfig } from './collaboration.js';
|
|
20
27
|
import FormGroup from '../../form/FormGroup.svelte';
|
|
21
28
|
import LinkActionMenu from './LinkActionMenu.svelte';
|
|
@@ -299,6 +306,8 @@
|
|
|
299
306
|
Alert,
|
|
300
307
|
TabHandler,
|
|
301
308
|
TableKit.configure({ table: { resizable: true } }),
|
|
309
|
+
// Keep `class` on standard nodes/marks so classes in loaded HTML survive
|
|
310
|
+
ClassAttribute,
|
|
302
311
|
...customExtensions
|
|
303
312
|
];
|
|
304
313
|
|
|
@@ -15,7 +15,14 @@
|
|
|
15
15
|
import { TextStyle } from '@tiptap/extension-text-style';
|
|
16
16
|
import Collaboration from '@tiptap/extension-collaboration';
|
|
17
17
|
import { CollaborationCaret } from '@tiptap/extension-collaboration-caret';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
Alert,
|
|
20
|
+
ClassAttribute,
|
|
21
|
+
CodeBlockEditor,
|
|
22
|
+
Div,
|
|
23
|
+
Span,
|
|
24
|
+
type CodeBlocksOptions
|
|
25
|
+
} from './extensions/index.js';
|
|
19
26
|
import type { CollaborationConfig } from './collaboration.js';
|
|
20
27
|
import FormGroup from '../../form/FormGroup.svelte';
|
|
21
28
|
import LinkActionMenu from './LinkActionMenu.svelte';
|
|
@@ -263,6 +270,8 @@
|
|
|
263
270
|
Alert,
|
|
264
271
|
TabHandler,
|
|
265
272
|
TableKit.configure({ table: { resizable: true } }),
|
|
273
|
+
// Keep `class` on standard nodes/marks so classes in loaded HTML survive
|
|
274
|
+
ClassAttribute,
|
|
266
275
|
...customExtensions
|
|
267
276
|
];
|
|
268
277
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Node and mark types that keep their `class` attribute by default. Types that
|
|
4
|
+
* already manage `class` themselves (div, span, alert, link) are left alone.
|
|
5
|
+
*/
|
|
6
|
+
export declare const defaultClassAttributeTypes: readonly ["paragraph", "heading", "blockquote", "bulletList", "orderedList", "listItem", "codeBlock", "horizontalRule", "image", "table", "tableRow", "tableHeader", "tableCell", "bold", "italic", "strike", "code", "underline", "subscript", "superscript", "textStyle"];
|
|
7
|
+
export interface ClassAttributeOptions {
|
|
8
|
+
/** Node and mark type names that should preserve `class` (default: all standard types) */
|
|
9
|
+
types: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Preserves the `class` attribute on standard nodes and marks so classes in
|
|
13
|
+
* loaded or pasted HTML survive the round-trip through the editor instead of
|
|
14
|
+
* being stripped by the schema.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ClassAttribute: Extension<ClassAttributeOptions, any>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Node and mark types that keep their `class` attribute by default. Types that
|
|
4
|
+
* already manage `class` themselves (div, span, alert, link) are left alone.
|
|
5
|
+
*/
|
|
6
|
+
export const defaultClassAttributeTypes = [
|
|
7
|
+
'paragraph',
|
|
8
|
+
'heading',
|
|
9
|
+
'blockquote',
|
|
10
|
+
'bulletList',
|
|
11
|
+
'orderedList',
|
|
12
|
+
'listItem',
|
|
13
|
+
'codeBlock',
|
|
14
|
+
'horizontalRule',
|
|
15
|
+
'image',
|
|
16
|
+
'table',
|
|
17
|
+
'tableRow',
|
|
18
|
+
'tableHeader',
|
|
19
|
+
'tableCell',
|
|
20
|
+
'bold',
|
|
21
|
+
'italic',
|
|
22
|
+
'strike',
|
|
23
|
+
'code',
|
|
24
|
+
'underline',
|
|
25
|
+
'subscript',
|
|
26
|
+
'superscript',
|
|
27
|
+
'textStyle'
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Preserves the `class` attribute on standard nodes and marks so classes in
|
|
31
|
+
* loaded or pasted HTML survive the round-trip through the editor instead of
|
|
32
|
+
* being stripped by the schema.
|
|
33
|
+
*/
|
|
34
|
+
export const ClassAttribute = Extension.create({
|
|
35
|
+
name: 'classAttribute',
|
|
36
|
+
addOptions() {
|
|
37
|
+
return {
|
|
38
|
+
types: [...defaultClassAttributeTypes]
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
addGlobalAttributes() {
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
types: this.options.types,
|
|
45
|
+
attributes: {
|
|
46
|
+
class: {
|
|
47
|
+
default: null,
|
|
48
|
+
parseHTML: (element) => element.getAttribute('class') || null,
|
|
49
|
+
renderHTML: (attributes) => {
|
|
50
|
+
if (!attributes.class)
|
|
51
|
+
return {};
|
|
52
|
+
return { class: attributes.class };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { Alert } from './Alert.js';
|
|
2
2
|
export { Div } from './Div.js';
|
|
3
3
|
export { Span } from './Span.js';
|
|
4
|
+
export { ClassAttribute, defaultClassAttributeTypes } from './ClassAttribute.js';
|
|
5
|
+
export type { ClassAttributeOptions } from './ClassAttribute.js';
|
|
4
6
|
export { CodeBlockEditor } from './CodeBlockEditor.js';
|
|
5
7
|
export type { CodeBlockEditorOptions, CodeBlocksOptions } from './CodeBlockEditor.js';
|
|
6
8
|
export { codeBlockLanguages, resolveCodeBlockLanguage } from './codeBlockLanguages.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Alert } from './Alert.js';
|
|
2
2
|
export { Div } from './Div.js';
|
|
3
3
|
export { Span } from './Span.js';
|
|
4
|
+
export { ClassAttribute, defaultClassAttributeTypes } from './ClassAttribute.js';
|
|
4
5
|
export { CodeBlockEditor } from './CodeBlockEditor.js';
|
|
5
6
|
export { codeBlockLanguages, resolveCodeBlockLanguage } from './codeBlockLanguages.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -114,8 +114,8 @@ export type { TipTapProps, DocumentUploadResult } from './editors/tiptap/TipTap.
|
|
|
114
114
|
export { default as TipTapBubble } from './editors/tiptap/TipTapBubble.svelte';
|
|
115
115
|
export type { TipTapBubbleProps } from './editors/tiptap/TipTapBubble.svelte';
|
|
116
116
|
export type { CollaborationConfig, CollaborationUser } from './editors/tiptap/collaboration.js';
|
|
117
|
-
export { CodeBlockEditor, codeBlockLanguages, resolveCodeBlockLanguage } from './editors/tiptap/extensions/index.js';
|
|
118
|
-
export type { CodeBlocksOptions, CodeBlockEditorOptions, CodeBlockLanguageDef, CodeBlockLanguageId } from './editors/tiptap/extensions/index.js';
|
|
117
|
+
export { ClassAttribute, defaultClassAttributeTypes, CodeBlockEditor, codeBlockLanguages, resolveCodeBlockLanguage } from './editors/tiptap/extensions/index.js';
|
|
118
|
+
export type { ClassAttributeOptions, CodeBlocksOptions, CodeBlockEditorOptions, CodeBlockLanguageDef, CodeBlockLanguageId } from './editors/tiptap/extensions/index.js';
|
|
119
119
|
export type { AnyExtension } from '@tiptap/core';
|
|
120
120
|
export { editorButtonVariants, editorButtonSizes, editorButtonClass, parseEditorButtonClass } from './editors/tiptap/buttonLink.js';
|
|
121
121
|
export type { EditorButtonVariant, EditorButtonSize, EditorButtonStyle } from './editors/tiptap/buttonLink.js';
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ export { default as ColorPicker } from './form/ColorPicker.svelte';
|
|
|
56
56
|
export { parseColor, parseHex, toHex, formatColor, rgbToHsv, hsvToRgb, rgbToHsl } from './form/ColorPicker.svelte';
|
|
57
57
|
export { default as TipTap } from './editors/tiptap/TipTap.svelte';
|
|
58
58
|
export { default as TipTapBubble } from './editors/tiptap/TipTapBubble.svelte';
|
|
59
|
-
export { CodeBlockEditor, codeBlockLanguages, resolveCodeBlockLanguage } from './editors/tiptap/extensions/index.js';
|
|
59
|
+
export { ClassAttribute, defaultClassAttributeTypes, CodeBlockEditor, codeBlockLanguages, resolveCodeBlockLanguage } from './editors/tiptap/extensions/index.js';
|
|
60
60
|
export { editorButtonVariants, editorButtonSizes, editorButtonClass, parseEditorButtonClass } from './editors/tiptap/buttonLink.js';
|
|
61
61
|
export { default as CodeMirror } from './editors/CodeMirror.svelte';
|
|
62
62
|
export { default as GitCard } from './cards/GitCard.svelte';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import '../
|
|
3
|
+
import '../styles.css';
|
|
4
4
|
import '../app.css';
|
|
5
5
|
|
|
6
6
|
export interface AppShellProps {
|
|
@@ -11,9 +11,4 @@
|
|
|
11
11
|
let { children }: AppShellProps = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
|
-
<!--
|
|
15
|
-
AppShell loads the library's base stylesheet plus the bundled Bootstrap 5 build.
|
|
16
|
-
To use the library without Bootstrap, skip AppShell and import
|
|
17
|
-
`@placeholderco/placeholder-ui/app.css` directly in your root layout instead.
|
|
18
|
-
-->
|
|
19
14
|
{@render children?.()}
|
|
@@ -4,6 +4,62 @@
|
|
|
4
4
|
--gutter-y: 0
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
h1,.display-1 {
|
|
8
|
+
font-size: clamp(2.25rem, 4vw + 1rem, 3.9rem);
|
|
9
|
+
font-style: normal;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
line-height: 3.625rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
h2,.display-2 {
|
|
15
|
+
font-size: clamp(1.85rem, 3vw + 0.85rem, 3.1rem);
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
line-height: 2.5rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
h3,.display-3 {
|
|
22
|
+
font-size: clamp(1.5rem, 2.2vw + 0.75rem, 2.5rem);
|
|
23
|
+
font-style: normal;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
line-height: 2.5rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
h4,.display-4 {
|
|
29
|
+
font-size: clamp(1.25rem, 1.5vw + 0.7rem, 2rem);
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
line-height: 2.125rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h5,.display-5 {
|
|
36
|
+
font-size: clamp(1.1rem, 0.9vw + 0.7rem, 1.6rem);
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
line-height: 1.875rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
h6,.display-6 {
|
|
43
|
+
font-size: clamp(1rem, 0.5vw + 0.75rem, 1.25rem);
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
line-height: 1.625rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
h7,.display-7 {
|
|
50
|
+
font-size: 1rem;
|
|
51
|
+
font-style: normal;
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
line-height: 1.25rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
h8,.display-8 {
|
|
57
|
+
font-size: 0.875rem;
|
|
58
|
+
font-style: normal;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
line-height: 1.125rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
7
63
|
.text-black,
|
|
8
64
|
.text-black-50,
|
|
9
65
|
.text-body,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@placeholderco/placeholder-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "A modern, customizable Svelte 5 UI component library with comprehensive theming support. Re-brand it with a single config object.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Placeholderco",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"svelte": "./dist/index.js"
|
|
46
46
|
},
|
|
47
47
|
"./app.css": "./dist/app.css",
|
|
48
|
-
"./
|
|
48
|
+
"./styles.css": "./dist/styles.css"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@sveltejs/kit": "^2.26.0",
|