plugin-build-guide-block 1.0.1 → 1.0.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.
- package/dist/client/UserGuideBlock.d.ts +2 -0
- package/dist/client/UserGuideBlockInitializer.d.ts +2 -0
- package/dist/client/UserGuideBlockProvider.d.ts +2 -0
- package/dist/client/UserGuideManager.d.ts +2 -0
- package/dist/client/components/BuildButton.d.ts +2 -0
- package/dist/client/components/LLMServiceSelect.d.ts +2 -0
- package/dist/client/components/ModelSelect.d.ts +2 -0
- package/dist/client/components/StatusTag.d.ts +2 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client/models/UserGuideBlockModel.d.ts +3 -0
- package/dist/client/models/index.d.ts +11 -0
- package/dist/client/plugin.d.ts +5 -0
- package/dist/client/schemas/spacesSchema.d.ts +305 -0
- package/dist/index.d.ts +2 -0
- package/dist/node_modules/sanitize-html/LICENSE +7 -0
- package/dist/node_modules/sanitize-html/index.js +7 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/async/index.browser.cjs +34 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/async/index.browser.js +34 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/async/index.cjs +35 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/async/index.d.ts +56 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/async/index.js +35 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/async/index.native.js +26 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/async/package.json +12 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/bin/nanoid.cjs +55 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/index.browser.cjs +34 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/index.browser.js +34 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/index.cjs +45 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/index.d.cts +91 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/index.d.ts +91 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/index.js +45 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/nanoid.js +1 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/non-secure/index.cjs +21 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/non-secure/index.d.ts +33 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/non-secure/index.js +21 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/non-secure/package.json +6 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/package.json +88 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/url-alphabet/index.cjs +3 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/url-alphabet/index.js +3 -0
- package/dist/node_modules/sanitize-html/node_modules/nanoid/url-alphabet/package.json +6 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/at-rule.d.ts +115 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/at-rule.js +25 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/comment.d.ts +67 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/comment.js +13 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/container.d.ts +452 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/container.js +439 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/css-syntax-error.d.ts +248 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/css-syntax-error.js +100 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/declaration.d.ts +148 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/declaration.js +24 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/document.d.ts +68 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/document.js +33 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/fromJSON.d.ts +9 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/fromJSON.js +54 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/input.d.ts +194 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/input.js +248 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/lazy-result.d.ts +190 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/lazy-result.js +550 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/list.d.ts +57 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/list.js +58 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/map-generator.js +359 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/no-work-result.d.ts +46 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/no-work-result.js +135 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/node.d.ts +536 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/node.js +381 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/parse.d.ts +9 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/parse.js +42 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/parser.js +610 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/postcss.d.mts +72 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/postcss.d.ts +441 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/postcss.js +101 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/previous-map.d.ts +81 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/previous-map.js +142 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/processor.d.ts +115 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/processor.js +67 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/result.d.ts +206 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/result.js +42 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/root.d.ts +86 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/root.js +61 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/rule.d.ts +113 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/rule.js +27 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/stringifier.d.ts +46 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/stringifier.js +353 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/stringify.d.ts +9 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/stringify.js +11 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/symbols.js +5 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/terminal-highlight.js +70 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/tokenize.js +266 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/warn-once.js +13 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/warning.d.ts +147 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/lib/warning.js +37 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/node_modules/.bin/nanoid +15 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/node_modules/.bin/nanoid.cmd +7 -0
- package/dist/node_modules/sanitize-html/node_modules/postcss/package.json +88 -0
- package/dist/node_modules/sanitize-html/package.json +1 -0
- package/dist/server/actions/build.d.ts +2 -0
- package/dist/server/actions/getHtml.d.ts +2 -0
- package/dist/server/collections/ai-build-guide-spaces.d.ts +2 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/plugin.d.ts +11 -0
- package/package.json +9 -1
- package/src/client/UserGuideBlock.tsx +53 -0
- package/src/client/UserGuideBlockInitializer.tsx +26 -0
- package/src/client/UserGuideBlockProvider.tsx +12 -0
- package/src/client/UserGuideManager.tsx +133 -0
- package/src/client/client.d.ts +249 -0
- package/src/client/components/BuildButton.tsx +43 -0
- package/src/client/components/LLMServiceSelect.tsx +44 -0
- package/src/client/components/ModelSelect.tsx +41 -0
- package/src/client/components/StatusTag.tsx +17 -0
- package/src/client/index.tsx +1 -0
- package/src/client/models/UserGuideBlockModel.ts +47 -0
- package/src/client/models/index.ts +12 -0
- package/src/client/plugin.tsx +30 -0
- package/src/client/schemas/spacesSchema.ts +305 -0
- package/src/index.ts +2 -0
- package/src/locale/en-US.json +27 -0
- package/src/locale/vi-VN.json +27 -0
- package/src/locale/zh-CN.json +27 -0
- package/src/server/actions/build.ts +171 -0
- package/src/server/actions/getHtml.ts +26 -0
- package/src/server/collections/.gitkeep +0 -0
- package/src/server/collections/ai-build-guide-spaces.ts +49 -0
- package/src/server/index.ts +1 -0
- package/src/server/plugin.ts +42 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate URL-friendly unique ID. This method uses the non-secure
|
|
3
|
+
* predictable random generator with bigger collision probability.
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* import { nanoid } from 'nanoid/non-secure'
|
|
7
|
+
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @param size Size of the ID. The default size is 21.
|
|
11
|
+
* @returns A random string.
|
|
12
|
+
*/
|
|
13
|
+
export function nanoid(size?: number): string
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Generate a unique ID based on a custom alphabet.
|
|
17
|
+
* This method uses the non-secure predictable random generator
|
|
18
|
+
* with bigger collision probability.
|
|
19
|
+
*
|
|
20
|
+
* @param alphabet Alphabet used to generate the ID.
|
|
21
|
+
* @param defaultSize Size of the ID. The default size is 21.
|
|
22
|
+
* @returns A random string generator.
|
|
23
|
+
*
|
|
24
|
+
* ```js
|
|
25
|
+
* import { customAlphabet } from 'nanoid/non-secure'
|
|
26
|
+
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
|
|
27
|
+
* model.id = //=> "8ё56а"
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function customAlphabet(
|
|
31
|
+
alphabet: string,
|
|
32
|
+
defaultSize?: number
|
|
33
|
+
): (size?: number) => string
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
let urlAlphabet =
|
|
2
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
|
3
|
+
let customAlphabet = (alphabet, defaultSize = 21) => {
|
|
4
|
+
return (size = defaultSize) => {
|
|
5
|
+
let id = ''
|
|
6
|
+
let i = size
|
|
7
|
+
while (i--) {
|
|
8
|
+
id += alphabet[(Math.random() * alphabet.length) | 0]
|
|
9
|
+
}
|
|
10
|
+
return id
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
let nanoid = (size = 21) => {
|
|
14
|
+
let id = ''
|
|
15
|
+
let i = size
|
|
16
|
+
while (i--) {
|
|
17
|
+
id += urlAlphabet[(Math.random() * 64) | 0]
|
|
18
|
+
}
|
|
19
|
+
return id
|
|
20
|
+
}
|
|
21
|
+
export { nanoid, customAlphabet }
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nanoid",
|
|
3
|
+
"version": "3.3.7",
|
|
4
|
+
"description": "A tiny (116 bytes), secure URL-friendly unique string ID generator",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"uuid",
|
|
7
|
+
"random",
|
|
8
|
+
"id",
|
|
9
|
+
"url"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
|
13
|
+
},
|
|
14
|
+
"funding": [
|
|
15
|
+
{
|
|
16
|
+
"type": "github",
|
|
17
|
+
"url": "https://github.com/sponsors/ai"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"author": "Andrey Sitnik <andrey@sitnik.ru>",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": "ai/nanoid",
|
|
23
|
+
"browser": {
|
|
24
|
+
"./index.js": "./index.browser.js",
|
|
25
|
+
"./async/index.js": "./async/index.browser.js",
|
|
26
|
+
"./async/index.cjs": "./async/index.browser.cjs",
|
|
27
|
+
"./index.cjs": "./index.browser.cjs"
|
|
28
|
+
},
|
|
29
|
+
"react-native": "index.js",
|
|
30
|
+
"bin": "./bin/nanoid.cjs",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"types": "./index.d.ts",
|
|
33
|
+
"type": "module",
|
|
34
|
+
"main": "index.cjs",
|
|
35
|
+
"module": "index.js",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"browser": "./index.browser.js",
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./index.d.cts",
|
|
41
|
+
"default": "./index.cjs"
|
|
42
|
+
},
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./index.d.ts",
|
|
45
|
+
"default": "./index.js"
|
|
46
|
+
},
|
|
47
|
+
"default": "./index.js"
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json",
|
|
50
|
+
"./async/package.json": "./async/package.json",
|
|
51
|
+
"./async": {
|
|
52
|
+
"browser": "./async/index.browser.js",
|
|
53
|
+
"require": {
|
|
54
|
+
"types": "./index.d.cts",
|
|
55
|
+
"default": "./async/index.cjs"
|
|
56
|
+
},
|
|
57
|
+
"import": {
|
|
58
|
+
"types": "./index.d.ts",
|
|
59
|
+
"default": "./async/index.js"
|
|
60
|
+
},
|
|
61
|
+
"default": "./async/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./non-secure/package.json": "./non-secure/package.json",
|
|
64
|
+
"./non-secure": {
|
|
65
|
+
"require": {
|
|
66
|
+
"types": "./index.d.cts",
|
|
67
|
+
"default": "./non-secure/index.cjs"
|
|
68
|
+
},
|
|
69
|
+
"import": {
|
|
70
|
+
"types": "./index.d.ts",
|
|
71
|
+
"default": "./non-secure/index.js"
|
|
72
|
+
},
|
|
73
|
+
"default": "./non-secure/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./url-alphabet/package.json": "./url-alphabet/package.json",
|
|
76
|
+
"./url-alphabet": {
|
|
77
|
+
"require": {
|
|
78
|
+
"types": "./index.d.cts",
|
|
79
|
+
"default": "./url-alphabet/index.cjs"
|
|
80
|
+
},
|
|
81
|
+
"import": {
|
|
82
|
+
"types": "./index.d.ts",
|
|
83
|
+
"default": "./url-alphabet/index.js"
|
|
84
|
+
},
|
|
85
|
+
"default": "./url-alphabet/index.js"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import Container, { ContainerProps } from './container.js'
|
|
2
|
+
|
|
3
|
+
declare namespace AtRule {
|
|
4
|
+
export interface AtRuleRaws extends Record<string, unknown> {
|
|
5
|
+
/**
|
|
6
|
+
* The space symbols after the last child of the node to the end of the node.
|
|
7
|
+
*/
|
|
8
|
+
after?: string
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The space between the at-rule name and its parameters.
|
|
12
|
+
*/
|
|
13
|
+
afterName?: string
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The space symbols before the node. It also stores `*`
|
|
17
|
+
* and `_` symbols before the declaration (IE hack).
|
|
18
|
+
*/
|
|
19
|
+
before?: string
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The symbols between the last parameter and `{` for rules.
|
|
23
|
+
*/
|
|
24
|
+
between?: string
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The rule’s selector with comments.
|
|
28
|
+
*/
|
|
29
|
+
params?: {
|
|
30
|
+
raw: string
|
|
31
|
+
value: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Contains `true` if the last child has an (optional) semicolon.
|
|
36
|
+
*/
|
|
37
|
+
semicolon?: boolean
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface AtRuleProps extends ContainerProps {
|
|
41
|
+
/** Name of the at-rule. */
|
|
42
|
+
name: string
|
|
43
|
+
/** Parameters following the name of the at-rule. */
|
|
44
|
+
params?: number | string
|
|
45
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
|
46
|
+
raws?: AtRuleRaws
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
50
|
+
export { AtRule_ as default }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Represents an at-rule.
|
|
55
|
+
*
|
|
56
|
+
* ```js
|
|
57
|
+
* Once (root, { AtRule }) {
|
|
58
|
+
* let media = new AtRule({ name: 'media', params: 'print' })
|
|
59
|
+
* media.append(…)
|
|
60
|
+
* root.append(media)
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* If it’s followed in the CSS by a `{}` block, this node will have
|
|
65
|
+
* a nodes property representing its children.
|
|
66
|
+
*
|
|
67
|
+
* ```js
|
|
68
|
+
* const root = postcss.parse('@charset "UTF-8"; @media print {}')
|
|
69
|
+
*
|
|
70
|
+
* const charset = root.first
|
|
71
|
+
* charset.type //=> 'atrule'
|
|
72
|
+
* charset.nodes //=> undefined
|
|
73
|
+
*
|
|
74
|
+
* const media = root.last
|
|
75
|
+
* media.nodes //=> []
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
declare class AtRule_ extends Container {
|
|
79
|
+
/**
|
|
80
|
+
* The at-rule’s name immediately follows the `@`.
|
|
81
|
+
*
|
|
82
|
+
* ```js
|
|
83
|
+
* const root = postcss.parse('@media print {}')
|
|
84
|
+
* media.name //=> 'media'
|
|
85
|
+
* const media = root.first
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
name: string
|
|
89
|
+
/**
|
|
90
|
+
* The at-rule’s parameters, the values that follow the at-rule’s name
|
|
91
|
+
* but precede any `{}` block.
|
|
92
|
+
*
|
|
93
|
+
* ```js
|
|
94
|
+
* const root = postcss.parse('@media print, screen {}')
|
|
95
|
+
* const media = root.first
|
|
96
|
+
* media.params //=> 'print, screen'
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
params: string
|
|
100
|
+
parent: Container | undefined
|
|
101
|
+
|
|
102
|
+
raws: AtRule.AtRuleRaws
|
|
103
|
+
|
|
104
|
+
type: 'atrule'
|
|
105
|
+
|
|
106
|
+
constructor(defaults?: AtRule.AtRuleProps)
|
|
107
|
+
assign(overrides: AtRule.AtRuleProps | object): this
|
|
108
|
+
clone(overrides?: Partial<AtRule.AtRuleProps>): AtRule
|
|
109
|
+
cloneAfter(overrides?: Partial<AtRule.AtRuleProps>): AtRule
|
|
110
|
+
cloneBefore(overrides?: Partial<AtRule.AtRuleProps>): AtRule
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare class AtRule extends AtRule_ {}
|
|
114
|
+
|
|
115
|
+
export = AtRule
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
let Container = require('./container')
|
|
4
|
+
|
|
5
|
+
class AtRule extends Container {
|
|
6
|
+
constructor(defaults) {
|
|
7
|
+
super(defaults)
|
|
8
|
+
this.type = 'atrule'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
append(...children) {
|
|
12
|
+
if (!this.proxyOf.nodes) this.nodes = []
|
|
13
|
+
return super.append(...children)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
prepend(...children) {
|
|
17
|
+
if (!this.proxyOf.nodes) this.nodes = []
|
|
18
|
+
return super.prepend(...children)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = AtRule
|
|
23
|
+
AtRule.default = AtRule
|
|
24
|
+
|
|
25
|
+
Container.registerAtRule(AtRule)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Container from './container.js'
|
|
2
|
+
import Node, { NodeProps } from './node.js'
|
|
3
|
+
|
|
4
|
+
declare namespace Comment {
|
|
5
|
+
export interface CommentRaws extends Record<string, unknown> {
|
|
6
|
+
/**
|
|
7
|
+
* The space symbols before the node.
|
|
8
|
+
*/
|
|
9
|
+
before?: string
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The space symbols between `/*` and the comment’s text.
|
|
13
|
+
*/
|
|
14
|
+
left?: string
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The space symbols between the comment’s text.
|
|
18
|
+
*/
|
|
19
|
+
right?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CommentProps extends NodeProps {
|
|
23
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
|
24
|
+
raws?: CommentRaws
|
|
25
|
+
/** Content of the comment. */
|
|
26
|
+
text: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
30
|
+
export { Comment_ as default }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* It represents a class that handles
|
|
35
|
+
* [CSS comments](https://developer.mozilla.org/en-US/docs/Web/CSS/Comments)
|
|
36
|
+
*
|
|
37
|
+
* ```js
|
|
38
|
+
* Once (root, { Comment }) {
|
|
39
|
+
* const note = new Comment({ text: 'Note: …' })
|
|
40
|
+
* root.append(note)
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Remember that CSS comments inside selectors, at-rule parameters,
|
|
45
|
+
* or declaration values will be stored in the `raws` properties
|
|
46
|
+
* explained above.
|
|
47
|
+
*/
|
|
48
|
+
declare class Comment_ extends Node {
|
|
49
|
+
parent: Container | undefined
|
|
50
|
+
raws: Comment.CommentRaws
|
|
51
|
+
/**
|
|
52
|
+
* The comment's text.
|
|
53
|
+
*/
|
|
54
|
+
text: string
|
|
55
|
+
|
|
56
|
+
type: 'comment'
|
|
57
|
+
|
|
58
|
+
constructor(defaults?: Comment.CommentProps)
|
|
59
|
+
assign(overrides: Comment.CommentProps | object): this
|
|
60
|
+
clone(overrides?: Partial<Comment.CommentProps>): Comment
|
|
61
|
+
cloneAfter(overrides?: Partial<Comment.CommentProps>): Comment
|
|
62
|
+
cloneBefore(overrides?: Partial<Comment.CommentProps>): Comment
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare class Comment extends Comment_ {}
|
|
66
|
+
|
|
67
|
+
export = Comment
|