@shelamkoff/rector 1.0.4 → 1.0.5
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 +11 -5
- package/dist/core/PopupManager.js +2 -2
- package/dist/core/index.js +38 -24
- package/dist/core/types.d.ts +7 -3
- package/dist/inline-plugins/color/README.md +1 -2
- package/dist/inline-plugins/color/README.ru.md +1 -2
- package/dist/inline-plugins/color.js +1 -12
- package/dist/inline-plugins/mention/README.md +1 -2
- package/dist/inline-plugins/mention/README.ru.md +1 -2
- package/dist/inline-plugins/mention/index.js +5 -10
- package/dist/plugins/attaches/README.md +0 -1
- package/dist/plugins/attaches/README.ru.md +0 -1
- package/dist/plugins/carousel/README.md +0 -1
- package/dist/plugins/carousel/README.ru.md +0 -1
- package/dist/plugins/checklist/README.md +0 -1
- package/dist/plugins/checklist/README.ru.md +0 -1
- package/dist/plugins/code/README.md +0 -1
- package/dist/plugins/code/README.ru.md +0 -1
- package/dist/plugins/columns/README.md +0 -1
- package/dist/plugins/columns/README.ru.md +0 -1
- package/dist/plugins/delimiter/README.md +0 -1
- package/dist/plugins/delimiter/README.ru.md +0 -1
- package/dist/plugins/embed/README.md +0 -1
- package/dist/plugins/embed/README.ru.md +0 -1
- package/dist/plugins/gallery/README.md +0 -1
- package/dist/plugins/gallery/README.ru.md +0 -1
- package/dist/plugins/heading/README.md +0 -1
- package/dist/plugins/heading/README.ru.md +0 -1
- package/dist/plugins/image/README.md +0 -1
- package/dist/plugins/image/README.ru.md +0 -1
- package/dist/plugins/link-preview/README.md +0 -1
- package/dist/plugins/link-preview/README.ru.md +0 -1
- package/dist/plugins/list/README.md +0 -1
- package/dist/plugins/list/README.ru.md +0 -1
- package/dist/plugins/paragraph/README.md +0 -1
- package/dist/plugins/paragraph/README.ru.md +0 -1
- package/dist/plugins/person/README.md +0 -1
- package/dist/plugins/person/README.ru.md +0 -1
- package/dist/plugins/poll/README.md +0 -1
- package/dist/plugins/poll/README.ru.md +0 -1
- package/dist/plugins/quote/README.md +0 -1
- package/dist/plugins/quote/README.ru.md +0 -1
- package/dist/plugins/raw/README.md +0 -1
- package/dist/plugins/raw/README.ru.md +0 -1
- package/dist/plugins/spoiler/README.md +0 -1
- package/dist/plugins/spoiler/README.ru.md +0 -1
- package/dist/plugins/table/README.md +0 -1
- package/dist/plugins/table/README.ru.md +0 -1
- package/dist/plugins/toggle/README.md +0 -1
- package/dist/plugins/toggle/README.ru.md +0 -1
- package/dist/plugins/warning/README.md +0 -1
- package/dist/plugins/warning/README.ru.md +0 -1
- package/dist/renderer/index.js +71 -26
- package/dist/renderer/types.d.ts +4 -2
- package/dist/shared/cloneEditorData.js +14 -7
- package/dist/shared/styleRegistry.js +8 -3
- package/dist/styles/inline-plugins/color.css +1 -0
- package/dist/styles/inline-plugins/mention.css +1 -0
- package/dist/styles/plugins/attaches.css +2 -0
- package/dist/styles/plugins/carousel.css +2 -0
- package/dist/styles/plugins/checklist.css +1 -0
- package/dist/styles/plugins/code.css +1 -0
- package/dist/styles/plugins/columns.css +1 -0
- package/dist/styles/plugins/delimiter.css +1 -0
- package/dist/styles/plugins/embed.css +1 -0
- package/dist/styles/plugins/gallery.css +2 -0
- package/dist/styles/plugins/heading.css +1 -0
- package/dist/styles/plugins/image.css +2 -0
- package/dist/styles/plugins/link-preview.css +1 -0
- package/dist/styles/plugins/list.css +1 -0
- package/dist/styles/plugins/paragraph.css +1 -0
- package/dist/styles/plugins/person.css +2 -0
- package/dist/styles/plugins/poll.css +1 -0
- package/dist/styles/plugins/quote.css +1 -0
- package/dist/styles/plugins/raw.css +1 -0
- package/dist/styles/plugins/spoiler.css +1 -0
- package/dist/styles/plugins/table.css +1 -0
- package/dist/styles/plugins/toggle.css +1 -0
- package/dist/styles/plugins/warning.css +1 -0
- package/dist/styles/renderer.css +1 -0
- package/dist/styles/renderers/attaches.css +1 -0
- package/dist/styles/renderers/carousel.css +2 -0
- package/dist/styles/renderers/checklist.css +1 -0
- package/dist/styles/renderers/code.css +1 -0
- package/dist/styles/renderers/columns.css +1 -0
- package/dist/styles/renderers/delimiter.css +1 -0
- package/dist/styles/renderers/embed.css +1 -0
- package/dist/styles/renderers/gallery.css +2 -0
- package/dist/styles/renderers/heading.css +1 -0
- package/dist/styles/renderers/image.css +1 -0
- package/dist/styles/renderers/link-preview.css +1 -0
- package/dist/styles/renderers/list.css +1 -0
- package/dist/styles/renderers/paragraph.css +1 -0
- package/dist/styles/renderers/person.css +2 -0
- package/dist/styles/renderers/poll.css +1 -0
- package/dist/styles/renderers/quote.css +1 -0
- package/dist/styles/renderers/raw.css +1 -0
- package/dist/styles/renderers/spoiler.css +1 -0
- package/dist/styles/renderers/table.css +1 -0
- package/dist/styles/renderers/toggle.css +1 -0
- package/dist/styles/renderers/warning.css +1 -0
- package/dist/styles.css +46 -0
- package/package.json +15 -11
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Quote } from '@shelamkoff/rector/plugins/quote'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Quote } from '@shelamkoff/rector/plugins/quote'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Raw } from '@shelamkoff/rector/plugins/raw'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Raw } from '@shelamkoff/rector/plugins/raw'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Spoiler } from '@shelamkoff/rector/plugins/spoiler'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Spoiler } from '@shelamkoff/rector/plugins/spoiler'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Table } from '@shelamkoff/rector/plugins/table'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Table } from '@shelamkoff/rector/plugins/table'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Toggle } from '@shelamkoff/rector/plugins/toggle'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Toggle } from '@shelamkoff/rector/plugins/toggle'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Warning } from '@shelamkoff/rector/plugins/warning'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
|
@@ -11,7 +11,6 @@ npm install @shelamkoff/rector
|
|
|
11
11
|
```js
|
|
12
12
|
import { createEditor } from '@shelamkoff/rector'
|
|
13
13
|
import { Warning } from '@shelamkoff/rector/plugins/warning'
|
|
14
|
-
import '@shelamkoff/rector/styles/editor.css'
|
|
15
14
|
|
|
16
15
|
const editor = createEditor({
|
|
17
16
|
holder: document.querySelector('#editor'),
|
package/dist/renderer/index.js
CHANGED
|
@@ -16,8 +16,8 @@ const baseCssUrl = new URL('./styles/base.css', import.meta.url).href
|
|
|
16
16
|
* Renders Rector document blocks to DOM elements.
|
|
17
17
|
*/
|
|
18
18
|
export class EditorRenderer {
|
|
19
|
-
/** @type {{ classPrefix: string, throwOnUnknown: boolean, theme: 'dark' | 'light', validationMode: 'preserve' | 'strict', onValidationError?: (issue: { blockId?: string, type: string }) => void }} */
|
|
20
|
-
#config
|
|
19
|
+
/** @type {{ injectStyles: boolean, classPrefix: string, throwOnUnknown: boolean, theme: 'dark' | 'light', validationMode: 'preserve' | 'strict', onValidationError?: (issue: { blockId?: string, type: string }) => void }} */
|
|
20
|
+
#config
|
|
21
21
|
/** @type {Map<string, import('./types').BlockRenderer>} */
|
|
22
22
|
#renderers
|
|
23
23
|
/** @type {Map<string, import('./types').InlinePluginLike>} */
|
|
@@ -39,12 +39,22 @@ export class EditorRenderer {
|
|
|
39
39
|
/** Built-in types use the same neutral validators as their editor plugins. */
|
|
40
40
|
#defaultRendererTypes = new Set()
|
|
41
41
|
|
|
42
|
-
/** @type {import('./types').InlineParser} */
|
|
43
|
-
#parseInline
|
|
42
|
+
/** @type {import('./types').InlineParser} */
|
|
43
|
+
#parseInline
|
|
44
|
+
|
|
45
|
+
/** @type {{ destroy(): void } | null} */
|
|
46
|
+
#styleOwner = null
|
|
47
|
+
|
|
48
|
+
/** @type {string} */
|
|
49
|
+
#styleKey = ''
|
|
44
50
|
|
|
45
|
-
/** @param {import('./types').RendererConfig} [config] */
|
|
46
|
-
constructor(config = {}) {
|
|
47
|
-
|
|
51
|
+
/** @param {import('./types').RendererConfig} [config] */
|
|
52
|
+
constructor(config = {}) {
|
|
53
|
+
if (config.injectStyles !== undefined && typeof config.injectStyles !== 'boolean') {
|
|
54
|
+
throw new TypeError('EditorRenderer injectStyles must be a boolean')
|
|
55
|
+
}
|
|
56
|
+
this.#config = {
|
|
57
|
+
injectStyles: config.injectStyles ?? true,
|
|
48
58
|
classPrefix: config.classPrefix ?? 'editor',
|
|
49
59
|
throwOnUnknown: config.throwOnUnknown ?? true,
|
|
50
60
|
theme: config.theme ?? 'dark',
|
|
@@ -117,10 +127,16 @@ export class EditorRenderer {
|
|
|
117
127
|
* @param {import('./types').OutputBlockData} block
|
|
118
128
|
* @returns {HTMLElement}
|
|
119
129
|
*/
|
|
120
|
-
renderBlock(block) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
130
|
+
renderBlock(block) {
|
|
131
|
+
this.#ensureStyles()
|
|
132
|
+
try {
|
|
133
|
+
const entry = this.#createRenderedBlock(block)
|
|
134
|
+
this.#detachedBlocks.set(entry.element, entry)
|
|
135
|
+
return entry.element
|
|
136
|
+
} catch (error) {
|
|
137
|
+
this.#releaseAutomaticStylesIfIdle()
|
|
138
|
+
throw error
|
|
139
|
+
}
|
|
124
140
|
}
|
|
125
141
|
|
|
126
142
|
/**
|
|
@@ -196,7 +212,8 @@ export class EditorRenderer {
|
|
|
196
212
|
* @param {import('./types').OutputData} data
|
|
197
213
|
* @returns {HTMLElement}
|
|
198
214
|
*/
|
|
199
|
-
render(data) {
|
|
215
|
+
render(data) {
|
|
216
|
+
this.#ensureStyles()
|
|
200
217
|
const wrapper = document.createElement('div')
|
|
201
218
|
const theme = this.#config.theme
|
|
202
219
|
wrapper.className = `${this.#config.classPrefix}-content`
|
|
@@ -212,9 +229,10 @@ export class EditorRenderer {
|
|
|
212
229
|
wrapper.appendChild(entry.element)
|
|
213
230
|
}
|
|
214
231
|
}
|
|
215
|
-
} catch (error) {
|
|
216
|
-
for (const entry of created) this.#disposeRenderedElement(entry)
|
|
217
|
-
|
|
232
|
+
} catch (error) {
|
|
233
|
+
for (const entry of created) this.#disposeRenderedElement(entry)
|
|
234
|
+
this.#releaseAutomaticStylesIfIdle()
|
|
235
|
+
throw error
|
|
218
236
|
}
|
|
219
237
|
|
|
220
238
|
this.#detachedDocuments.set(wrapper, created)
|
|
@@ -260,7 +278,8 @@ export class EditorRenderer {
|
|
|
260
278
|
* @param {HTMLElement} container
|
|
261
279
|
* @returns {void}
|
|
262
280
|
*/
|
|
263
|
-
renderTo(data, container) {
|
|
281
|
+
renderTo(data, container) {
|
|
282
|
+
this.#ensureStyles()
|
|
264
283
|
const mounted = this.#mountedContainers.get(container)
|
|
265
284
|
const wrapper = mounted?.wrapper ?? document.createElement('div')
|
|
266
285
|
if (!mounted) {
|
|
@@ -306,9 +325,10 @@ export class EditorRenderer {
|
|
|
306
325
|
next.set(key, { element, type: block.type, signature, renderer: owner })
|
|
307
326
|
ordered.push(element)
|
|
308
327
|
}
|
|
309
|
-
} catch (error) {
|
|
310
|
-
for (const entry of created) this.#disposeRenderedElement(entry)
|
|
311
|
-
|
|
328
|
+
} catch (error) {
|
|
329
|
+
for (const entry of created) this.#disposeRenderedElement(entry)
|
|
330
|
+
this.#releaseAutomaticStylesIfIdle()
|
|
331
|
+
throw error
|
|
312
332
|
}
|
|
313
333
|
|
|
314
334
|
for (const [key, entry] of previous) {
|
|
@@ -329,7 +349,7 @@ export class EditorRenderer {
|
|
|
329
349
|
* container, or every resource owned by this renderer instance.
|
|
330
350
|
* @param {HTMLElement} [target]
|
|
331
351
|
*/
|
|
332
|
-
destroy(target) {
|
|
352
|
+
destroy(target) {
|
|
333
353
|
const containers = target
|
|
334
354
|
? (this.#mountedContainers.has(target) ? [target] : [])
|
|
335
355
|
: [...this.#mountedContainers.keys()]
|
|
@@ -358,12 +378,14 @@ export class EditorRenderer {
|
|
|
358
378
|
const blocks = target
|
|
359
379
|
? (this.#detachedBlocks.has(target) ? [target] : [])
|
|
360
380
|
: [...this.#detachedBlocks.keys()]
|
|
361
|
-
for (const element of blocks) {
|
|
381
|
+
for (const element of blocks) {
|
|
362
382
|
const entry = this.#detachedBlocks.get(element)
|
|
363
383
|
if (entry) this.#disposeRenderedElement(entry)
|
|
364
384
|
this.#detachedBlocks.delete(element)
|
|
365
|
-
element.replaceChildren()
|
|
366
|
-
}
|
|
385
|
+
element.replaceChildren()
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
this.#releaseAutomaticStylesIfIdle(!target)
|
|
367
389
|
}
|
|
368
390
|
|
|
369
391
|
/**
|
|
@@ -378,7 +400,7 @@ export class EditorRenderer {
|
|
|
378
400
|
* Collect all CSS URLs from base styles and registered renderers
|
|
379
401
|
* @returns {string[]}
|
|
380
402
|
*/
|
|
381
|
-
getStyleUrls() {
|
|
403
|
+
getStyleUrls() {
|
|
382
404
|
/** @type {Set<string>} */
|
|
383
405
|
const urls = new Set([baseCssUrl])
|
|
384
406
|
|
|
@@ -388,8 +410,31 @@ export class EditorRenderer {
|
|
|
388
410
|
}
|
|
389
411
|
}
|
|
390
412
|
|
|
391
|
-
return [...urls]
|
|
392
|
-
}
|
|
413
|
+
return [...urls]
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
#ensureStyles() {
|
|
417
|
+
if (!this.#config.injectStyles) return
|
|
418
|
+
const urls = this.getStyleUrls()
|
|
419
|
+
const key = urls.join('\n')
|
|
420
|
+
if (this.#styleOwner && this.#styleKey === key) return
|
|
421
|
+
const nextOwner = acquireStyleUrls(urls)
|
|
422
|
+
this.#styleOwner?.destroy()
|
|
423
|
+
this.#styleOwner = nextOwner
|
|
424
|
+
this.#styleKey = key
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/** Release automatic styles after the last rendered result, or unconditionally. */
|
|
428
|
+
#releaseAutomaticStylesIfIdle(force = false) {
|
|
429
|
+
if (!force && (
|
|
430
|
+
this.#mountedContainers.size > 0
|
|
431
|
+
|| this.#detachedDocuments.size > 0
|
|
432
|
+
|| this.#detachedBlocks.size > 0
|
|
433
|
+
)) return
|
|
434
|
+
this.#styleOwner?.destroy()
|
|
435
|
+
this.#styleOwner = null
|
|
436
|
+
this.#styleKey = ''
|
|
437
|
+
}
|
|
393
438
|
|
|
394
439
|
/**
|
|
395
440
|
* Inject <link> tags for all collected CSS URLs
|
package/dist/renderer/types.d.ts
CHANGED
|
@@ -418,8 +418,10 @@ export interface BlockRenderer<T extends OutputBlockData = OutputBlockData> {
|
|
|
418
418
|
mapTextFields?(data: T['data'], transform: (html: string) => string): void
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
export interface RendererConfig {
|
|
422
|
-
/**
|
|
421
|
+
export interface RendererConfig {
|
|
422
|
+
/** Automatically load base and registered-renderer styles on first render. Default: true. */
|
|
423
|
+
injectStyles?: boolean
|
|
424
|
+
/** Namespace used by generated renderer classes. Default: 'editor'. */
|
|
423
425
|
classPrefix?: string
|
|
424
426
|
/** Throw for an unregistered block instead of rendering a placeholder. Default: true. */
|
|
425
427
|
throwOnUnknown?: boolean
|
|
@@ -11,10 +11,17 @@ import { assertJsonValue } from './jsonData.js'
|
|
|
11
11
|
* @param {T} value
|
|
12
12
|
* @returns {T}
|
|
13
13
|
*/
|
|
14
|
-
export function cloneEditorData(value) {
|
|
15
|
-
assertJsonValue(value)
|
|
16
|
-
if (typeof structuredClone === 'function') {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
export function cloneEditorData(value) {
|
|
15
|
+
assertJsonValue(value)
|
|
16
|
+
if (typeof structuredClone === 'function') {
|
|
17
|
+
try {
|
|
18
|
+
return structuredClone(value)
|
|
19
|
+
} catch (error) {
|
|
20
|
+
const errorName = error && typeof error === 'object' && 'name' in error
|
|
21
|
+
? error.name
|
|
22
|
+
: undefined
|
|
23
|
+
if (errorName !== 'DataCloneError') throw error
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return JSON.parse(JSON.stringify(value))
|
|
27
|
+
}
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
const entries = new Map()
|
|
3
3
|
|
|
4
4
|
/** @param {string[]} urls */
|
|
5
|
-
export function acquireStyleUrls(urls) {
|
|
6
|
-
const
|
|
5
|
+
export function acquireStyleUrls(urls) {
|
|
6
|
+
const head = globalThis.document?.head
|
|
7
|
+
if (!head || typeof head.appendChild !== 'function') {
|
|
8
|
+
return { destroy() {} }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const tracked = []
|
|
7
12
|
for (const url of new Set(urls)) {
|
|
8
13
|
const existing = entries.get(url)
|
|
9
14
|
if (existing) {
|
|
@@ -13,7 +18,7 @@ export function acquireStyleUrls(urls) {
|
|
|
13
18
|
link.rel = 'stylesheet'
|
|
14
19
|
link.href = url
|
|
15
20
|
link.dataset.oeStyle = ''
|
|
16
|
-
|
|
21
|
+
head.appendChild(link)
|
|
17
22
|
entries.set(url, { count: 1, link })
|
|
18
23
|
}
|
|
19
24
|
tracked.push(url)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '@shelamkoff/color-picker/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../inline-plugins/mention/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/checklist/checklist.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/code/code.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/columns/columns.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/delimiter/delimiter.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/embed/embed.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/heading/heading.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/link-preview/link-preview.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/list/list.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/paragraph/paragraph.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/poll/poll.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/quote/quote.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/raw/raw.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/spoiler/spoiler.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/table/table.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/toggle/toggle.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../plugins/warning/warning.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../renderer/styles/base.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/attaches/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/checklist/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/code/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/columns/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/delimiter/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/embed/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/heading/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/image/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/link-preview/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/list/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/paragraph/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/poll/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/quote/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Raw rendering relies only on the shared renderer stylesheet. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/spoiler/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/table/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/toggle/styles.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../renderer/renderers/warning/styles.css';
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@import './styles/editor.css';
|
|
2
|
+
@import './styles/renderer.css';
|
|
3
|
+
@import './styles/plugins/paragraph.css';
|
|
4
|
+
@import './styles/plugins/heading.css';
|
|
5
|
+
@import './styles/plugins/list.css';
|
|
6
|
+
@import './styles/plugins/quote.css';
|
|
7
|
+
@import './styles/plugins/code.css';
|
|
8
|
+
@import './styles/plugins/image.css';
|
|
9
|
+
@import './styles/plugins/delimiter.css';
|
|
10
|
+
@import './styles/plugins/table.css';
|
|
11
|
+
@import './styles/plugins/checklist.css';
|
|
12
|
+
@import './styles/plugins/warning.css';
|
|
13
|
+
@import './styles/plugins/embed.css';
|
|
14
|
+
@import './styles/plugins/raw.css';
|
|
15
|
+
@import './styles/plugins/gallery.css';
|
|
16
|
+
@import './styles/plugins/carousel.css';
|
|
17
|
+
@import './styles/plugins/attaches.css';
|
|
18
|
+
@import './styles/plugins/link-preview.css';
|
|
19
|
+
@import './styles/plugins/toggle.css';
|
|
20
|
+
@import './styles/plugins/columns.css';
|
|
21
|
+
@import './styles/plugins/spoiler.css';
|
|
22
|
+
@import './styles/plugins/poll.css';
|
|
23
|
+
@import './styles/plugins/person.css';
|
|
24
|
+
@import './styles/inline-plugins/color.css';
|
|
25
|
+
@import './styles/inline-plugins/mention.css';
|
|
26
|
+
@import './styles/renderers/paragraph.css';
|
|
27
|
+
@import './styles/renderers/heading.css';
|
|
28
|
+
@import './styles/renderers/list.css';
|
|
29
|
+
@import './styles/renderers/quote.css';
|
|
30
|
+
@import './styles/renderers/code.css';
|
|
31
|
+
@import './styles/renderers/image.css';
|
|
32
|
+
@import './styles/renderers/delimiter.css';
|
|
33
|
+
@import './styles/renderers/table.css';
|
|
34
|
+
@import './styles/renderers/checklist.css';
|
|
35
|
+
@import './styles/renderers/warning.css';
|
|
36
|
+
@import './styles/renderers/embed.css';
|
|
37
|
+
@import './styles/renderers/raw.css';
|
|
38
|
+
@import './styles/renderers/gallery.css';
|
|
39
|
+
@import './styles/renderers/carousel.css';
|
|
40
|
+
@import './styles/renderers/attaches.css';
|
|
41
|
+
@import './styles/renderers/link-preview.css';
|
|
42
|
+
@import './styles/renderers/toggle.css';
|
|
43
|
+
@import './styles/renderers/columns.css';
|
|
44
|
+
@import './styles/renderers/spoiler.css';
|
|
45
|
+
@import './styles/renderers/poll.css';
|
|
46
|
+
@import './styles/renderers/person.css';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shelamkoff/rector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Extensible browser-native block editor with atomic history, versioned JSON, and document rendering",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -34,10 +34,11 @@
|
|
|
34
34
|
"types": "./dist/inline-plugins/color.d.ts",
|
|
35
35
|
"import": "./dist/inline-plugins/color.js"
|
|
36
36
|
},
|
|
37
|
-
"./inline-plugins/mention": {
|
|
38
|
-
"types": "./dist/inline-plugins/mention/index.d.ts",
|
|
39
|
-
"import": "./dist/inline-plugins/mention/index.js"
|
|
40
|
-
},
|
|
37
|
+
"./inline-plugins/mention": {
|
|
38
|
+
"types": "./dist/inline-plugins/mention/index.d.ts",
|
|
39
|
+
"import": "./dist/inline-plugins/mention/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./inline-plugins/*/styles.css": "./dist/styles/inline-plugins/*.css",
|
|
41
42
|
"./inline-tools": {
|
|
42
43
|
"types": "./dist/inline-tools/defaults.d.ts",
|
|
43
44
|
"import": "./dist/inline-tools/defaults.js"
|
|
@@ -65,16 +66,19 @@
|
|
|
65
66
|
"types": "./dist/renderer/renderers/async.d.ts",
|
|
66
67
|
"import": "./dist/renderer/renderers/async.js"
|
|
67
68
|
},
|
|
68
|
-
"./renderer/renderers/*": {
|
|
69
|
-
"types": "./dist/renderer/renderers/*/index.d.ts",
|
|
70
|
-
"import": "./dist/renderer/renderers/*/index.js"
|
|
71
|
-
},
|
|
69
|
+
"./renderer/renderers/*": {
|
|
70
|
+
"types": "./dist/renderer/renderers/*/index.d.ts",
|
|
71
|
+
"import": "./dist/renderer/renderers/*/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./renderer/renderers/*/styles.css": "./dist/styles/renderers/*.css",
|
|
72
74
|
"./locale/*": {
|
|
73
75
|
"types": "./dist/locale/*.d.ts",
|
|
74
76
|
"import": "./dist/locale/*.js"
|
|
75
77
|
},
|
|
76
|
-
"./styles
|
|
77
|
-
"./styles/
|
|
78
|
+
"./styles.css": "./dist/styles.css",
|
|
79
|
+
"./styles/editor.css": "./dist/styles/editor.css",
|
|
80
|
+
"./styles/renderer.css": "./dist/styles/renderer.css",
|
|
81
|
+
"./plugins/*/styles.css": "./dist/styles/plugins/*.css",
|
|
78
82
|
"./styles/themes/*": "./dist/core/themes/*.css",
|
|
79
83
|
"./package.json": "./package.json"
|
|
80
84
|
},
|