@marp-team/marp-core 3.4.2 → 3.6.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marp-team/marp-core",
3
- "version": "3.4.2",
3
+ "version": "3.6.0",
4
4
  "description": "The core of Marp tools",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -65,59 +65,59 @@
65
65
  "exec": "./node_modules/.bin/marp"
66
66
  },
67
67
  "devDependencies": {
68
- "@marp-team/marp-cli": "^2.2.2",
69
- "@rollup/plugin-alias": "^4.0.2",
70
- "@rollup/plugin-commonjs": "^24.0.0",
68
+ "@marp-team/marp-cli": "^2.4.0",
69
+ "@rollup/plugin-alias": "^4.0.3",
70
+ "@rollup/plugin-commonjs": "^24.0.1",
71
71
  "@rollup/plugin-json": "^6.0.0",
72
72
  "@rollup/plugin-node-resolve": "^15.0.1",
73
73
  "@rollup/plugin-replace": "^5.0.2",
74
- "@rollup/plugin-terser": "^0.3.0",
74
+ "@rollup/plugin-terser": "^0.4.0",
75
75
  "@rollup/plugin-typescript": "^11.0.0",
76
76
  "@tsconfig/node12": "^1.0.11",
77
- "@types/jest": "^29.2.5",
78
- "@typescript-eslint/eslint-plugin": "^5.48.0",
79
- "@typescript-eslint/parser": "^5.48.0",
80
- "autoprefixer": "^10.4.13",
77
+ "@twemoji/api": "^14.1.2",
78
+ "@types/jest": "^29.5.0",
79
+ "@typescript-eslint/eslint-plugin": "^5.56.0",
80
+ "@typescript-eslint/parser": "^5.56.0",
81
+ "autoprefixer": "^10.4.14",
81
82
  "cheerio": "^1.0.0-rc.12",
82
- "cssnano": "^5.1.14",
83
+ "cssnano": "^5.1.15",
83
84
  "emoji-regex": "^10.2.1",
84
- "eslint": "^8.31.0",
85
- "eslint-config-prettier": "^8.6.0",
86
- "eslint-plugin-import": "^2.26.0",
85
+ "eslint": "^8.36.0",
86
+ "eslint-config-prettier": "^8.8.0",
87
+ "eslint-plugin-import": "^2.27.5",
87
88
  "eslint-plugin-jest": "^27.2.1",
88
- "github-markdown-css": "^5.1.0",
89
- "jest": "^29.3.1",
90
- "jest-environment-jsdom": "^29.3.1",
89
+ "github-markdown-css": "^5.2.0",
90
+ "jest": "^29.5.0",
91
+ "jest-environment-jsdom": "^29.5.0",
91
92
  "jest-junit": "^15.0.0",
92
93
  "jest-plugin-context": "^2.9.0",
93
94
  "markdown-it": "^13.0.1",
94
95
  "markdown-it-emoji": "^2.0.2",
95
- "mkdirp": "^1.0.4",
96
- "nodemon": "^2.0.20",
96
+ "mkdirp": "^2.1.6",
97
+ "nodemon": "^2.0.22",
97
98
  "npm-run-all": "^4.1.5",
98
99
  "postcss-minify-params": "^5.1.4",
99
100
  "postcss-minify-selectors": "^5.2.1",
100
101
  "postcss-normalize-whitespace": "^5.1.1",
101
102
  "postcss-url": "^10.1.3",
102
- "prettier": "^2.8.2",
103
- "rimraf": "^3.0.2",
104
- "rollup": "^3.9.1",
103
+ "prettier": "^2.8.7",
104
+ "rimraf": "^4.4.1",
105
+ "rollup": "^3.20.2",
105
106
  "rollup-plugin-postcss": "^4.0.2",
106
107
  "rollup-plugin-string": "^3.0.0",
107
- "sass": "^1.57.1",
108
+ "sass": "^1.60.0",
108
109
  "sass-extended-importer": "^0.4.2",
109
110
  "self-closing-tags": "^1.0.1",
110
- "stylelint": "^14.16.1",
111
- "stylelint-config-prettier": "^9.0.4",
112
- "stylelint-config-standard-scss": "^6.1.0",
113
- "ts-jest": "29.0.3",
114
- "tslib": "^2.4.1",
115
- "twemoji": "^14.0.2",
116
- "typescript": "^4.9.4"
111
+ "stylelint": "^15.3.0",
112
+ "stylelint-config-prettier": "^9.0.5",
113
+ "stylelint-config-standard-scss": "^7.0.1",
114
+ "ts-jest": "29.0.5",
115
+ "tslib": "^2.5.0",
116
+ "typescript": "^5.0.2"
117
117
  },
118
118
  "dependencies": {
119
119
  "@marp-team/marpit": "^2.4.2",
120
- "@marp-team/marpit-svg-polyfill": "^2.0.0",
120
+ "@marp-team/marpit-svg-polyfill": "^2.1.0",
121
121
  "highlight.js": "^11.7.0",
122
122
  "katex": "^0.16.4",
123
123
  "mathjax-full": "^3.2.2",
@@ -1,5 +1,10 @@
1
1
  import { observer } from './observer';
2
- export { observer };
2
+ /**
3
+ * @internal
4
+ * @deprecated
5
+ */
6
+ declare const exportedObserver: typeof observer;
7
+ export { exportedObserver as observer };
3
8
  export interface MarpCoreBrowser {
4
9
  /** Clean-up observer for applying polyfills. */
5
10
  (): void;
@@ -55,8 +55,10 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
55
55
  slot: string;
56
56
  readonly tagName: string;
57
57
  attachShadow(init: ShadowRootInit): ShadowRoot;
58
+ checkVisibility(options?: CheckVisibilityOptions | undefined): boolean;
58
59
  closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
59
60
  closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
61
+ closest<K_4 extends keyof MathMLElementTagNameMap>(selector: K_4): MathMLElementTagNameMap[K_4] | null;
60
62
  closest<E extends Element = Element>(selectors: string): E | null;
61
63
  getAttribute(qualifiedName: string): string | null;
62
64
  getAttributeNS(namespace: string | null, localName: string): string | null;
@@ -66,11 +68,14 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
66
68
  getBoundingClientRect(): DOMRect;
67
69
  getClientRects(): DOMRectList;
68
70
  getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
69
- getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
70
- getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
71
+ getElementsByTagName<K_5 extends keyof HTMLElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<HTMLElementTagNameMap[K_5]>;
72
+ getElementsByTagName<K_6 extends keyof SVGElementTagNameMap>(qualifiedName: K_6): HTMLCollectionOf<SVGElementTagNameMap[K_6]>;
73
+ getElementsByTagName<K_7 extends keyof MathMLElementTagNameMap>(qualifiedName: K_7): HTMLCollectionOf<MathMLElementTagNameMap[K_7]>;
74
+ getElementsByTagName<K_8 extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K_8): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K_8]>;
71
75
  getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
72
76
  getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
73
77
  getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
78
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
74
79
  getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
75
80
  hasAttribute(qualifiedName: string): boolean;
76
81
  hasAttributeNS(namespace: string | null, localName: string): boolean;
@@ -128,24 +133,24 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
128
133
  normalize(): void;
129
134
  removeChild<T_3 extends Node>(child: T_3): T_3;
130
135
  replaceChild<T_4 extends Node>(node: Node, child: T_4): T_4;
131
- readonly ATTRIBUTE_NODE: number;
132
- readonly CDATA_SECTION_NODE: number;
133
- readonly COMMENT_NODE: number;
134
- readonly DOCUMENT_FRAGMENT_NODE: number;
135
- readonly DOCUMENT_NODE: number;
136
- readonly DOCUMENT_POSITION_CONTAINED_BY: number;
137
- readonly DOCUMENT_POSITION_CONTAINS: number;
138
- readonly DOCUMENT_POSITION_DISCONNECTED: number;
139
- readonly DOCUMENT_POSITION_FOLLOWING: number;
140
- readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
141
- readonly DOCUMENT_POSITION_PRECEDING: number;
142
- readonly DOCUMENT_TYPE_NODE: number;
143
- readonly ELEMENT_NODE: number;
144
- readonly ENTITY_NODE: number;
145
- readonly ENTITY_REFERENCE_NODE: number;
146
- readonly NOTATION_NODE: number;
147
- readonly PROCESSING_INSTRUCTION_NODE: number;
148
- readonly TEXT_NODE: number;
136
+ readonly ELEMENT_NODE: 1;
137
+ readonly ATTRIBUTE_NODE: 2;
138
+ readonly TEXT_NODE: 3;
139
+ readonly CDATA_SECTION_NODE: 4;
140
+ readonly ENTITY_REFERENCE_NODE: 5;
141
+ readonly ENTITY_NODE: 6;
142
+ readonly PROCESSING_INSTRUCTION_NODE: 7;
143
+ readonly COMMENT_NODE: 8;
144
+ readonly DOCUMENT_NODE: 9;
145
+ readonly DOCUMENT_TYPE_NODE: 10;
146
+ readonly DOCUMENT_FRAGMENT_NODE: 11;
147
+ readonly NOTATION_NODE: 12;
148
+ readonly DOCUMENT_POSITION_DISCONNECTED: 1;
149
+ readonly DOCUMENT_POSITION_PRECEDING: 2;
150
+ readonly DOCUMENT_POSITION_FOLLOWING: 4;
151
+ readonly DOCUMENT_POSITION_CONTAINS: 8;
152
+ readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
153
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
149
154
  dispatchEvent(event: Event): boolean;
150
155
  ariaAtomic: string | null;
151
156
  ariaAutoComplete: string | null;
@@ -153,7 +158,6 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
153
158
  ariaChecked: string | null;
154
159
  ariaColCount: string | null;
155
160
  ariaColIndex: string | null;
156
- ariaColIndexText: string | null;
157
161
  ariaColSpan: string | null;
158
162
  ariaCurrent: string | null;
159
163
  ariaDisabled: string | null;
@@ -177,7 +181,6 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
177
181
  ariaRoleDescription: string | null;
178
182
  ariaRowCount: string | null;
179
183
  ariaRowIndex: string | null;
180
- ariaRowIndexText: string | null;
181
184
  ariaRowSpan: string | null;
182
185
  ariaSelected: string | null;
183
186
  ariaSetSize: string | null;
@@ -202,17 +205,18 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
202
205
  readonly lastElementChild: Element | null;
203
206
  append(...nodes: (string | Node)[]): void;
204
207
  prepend(...nodes: (string | Node)[]): void;
205
- querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
206
- querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
208
+ querySelector<K_9 extends keyof HTMLElementTagNameMap>(selectors: K_9): HTMLElementTagNameMap[K_9] | null;
209
+ querySelector<K_10 extends keyof SVGElementTagNameMap>(selectors: K_10): SVGElementTagNameMap[K_10] | null;
210
+ querySelector<K_11 extends keyof MathMLElementTagNameMap>(selectors: K_11): MathMLElementTagNameMap[K_11] | null;
211
+ querySelector<K_12 extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K_12): HTMLElementDeprecatedTagNameMap[K_12] | null;
207
212
  querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
208
- querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
209
- querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
213
+ querySelectorAll<K_13 extends keyof HTMLElementTagNameMap>(selectors: K_13): NodeListOf<HTMLElementTagNameMap[K_13]>;
214
+ querySelectorAll<K_14 extends keyof SVGElementTagNameMap>(selectors: K_14): NodeListOf<SVGElementTagNameMap[K_14]>;
215
+ querySelectorAll<K_15 extends keyof MathMLElementTagNameMap>(selectors: K_15): NodeListOf<MathMLElementTagNameMap[K_15]>;
216
+ querySelectorAll<K_16 extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K_16): NodeListOf<HTMLElementDeprecatedTagNameMap[K_16]>;
210
217
  querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
211
218
  replaceChildren(...nodes: (string | Node)[]): void;
212
219
  readonly assignedSlot: HTMLSlotElement | null;
213
- oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
214
- oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
215
- onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
216
220
  readonly style: CSSStyleDeclaration;
217
221
  contentEditable: string;
218
222
  enterKeyHint: string;
@@ -233,7 +237,9 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
233
237
  onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
234
238
  onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
235
239
  oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
240
+ oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
236
241
  oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
242
+ oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
237
243
  ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
238
244
  ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
239
245
  ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
@@ -266,6 +272,7 @@ export declare const createMarpCustomElement: <T extends Constructor<HTMLElement
266
272
  onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
267
273
  onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
268
274
  onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
275
+ onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
269
276
  onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
270
277
  onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
278
  onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
@@ -2,6 +2,7 @@ import { Marpit, Options, ThemeSetPackOptions } from '@marp-team/marpit';
2
2
  import * as emojiPlugin from './emoji/emoji';
3
3
  import * as mathPlugin from './math/math';
4
4
  import * as scriptPlugin from './script/script';
5
+ import * as slugPlugin from './slug/slug';
5
6
  export interface MarpOptions extends Options {
6
7
  emoji?: emojiPlugin.EmojiOptions;
7
8
  html?: boolean | {
@@ -13,6 +14,7 @@ export interface MarpOptions extends Options {
13
14
  math?: mathPlugin.MathOptions;
14
15
  minifyCSS?: boolean;
15
16
  script?: boolean | scriptPlugin.ScriptOptions;
17
+ slug?: slugPlugin.SlugOptions;
16
18
  }
17
19
  export declare class Marp extends Marpit {
18
20
  readonly options: Required<MarpOptions>;
@@ -0,0 +1,12 @@
1
+ export type Slugifier = (text: string) => string;
2
+ export type PostSlugify = (slug: string, index: number) => string;
3
+ export type SlugOptions = boolean | Slugifier | SlugOptionsObject;
4
+ type SlugOptionsObject = {
5
+ slugifier?: Slugifier;
6
+ postSlugify?: PostSlugify;
7
+ };
8
+ export declare const markdown: Marpit.Plugin<[], {
9
+ marpit: Marpit.Marpit;
10
+ }>;
11
+ export declare const githubSlugify: Slugifier;
12
+ export {};