@estiva-app/ui 0.64.0 → 0.65.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/dist/CodeBlockColours.d.ts.map +1 -1
- package/dist/codeColours.d.ts +1 -12
- package/dist/codeColours.d.ts.map +1 -1
- package/dist/editor.js +11 -2
- package/dist/editor.js.map +2 -2
- package/dist/index.js +8 -5
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +2 -2
- package/src/CodeBlockColours.mdx +4 -3
- package/src/CodeBlockColours.test.ts +36 -0
- package/src/CodeBlockColours.ts +15 -1
- package/src/RichText.tsx +2 -2
- package/src/codeColours.ts +11 -3
- package/tailwind-preset.js +0 -1
- package/tokens.css +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlockColours.d.ts","sourceRoot":"","sources":["../src/CodeBlockColours.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlockColours.d.ts","sourceRoot":"","sources":["../src/CodeBlockColours.ts"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,4GAAuD,CAAA"}
|
package/dist/codeColours.d.ts
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
* Colours inside a code block, by language (Katerina, 9 October).
|
|
4
|
-
*
|
|
5
|
-
* highlight.js reads the code and names each word (a keyword, a string, a
|
|
6
|
-
* comment); RichText's class list gives each name its colour from the theme's
|
|
7
|
-
* `syntax-*` tokens. The same instance colours the editor's code block
|
|
8
|
-
* (`CodeBlockColours`), so what is written looks the same as what is read.
|
|
9
|
-
*
|
|
10
|
-
* `common` is highlight.js's 37 everyday languages. A language outside them, or
|
|
11
|
-
* none, leaves the code in one colour.
|
|
12
|
-
*/
|
|
13
|
-
export declare const lowlight: {
|
|
2
|
+
export declare function lowlight(): {
|
|
14
3
|
highlight: (language: string, value: string, options?: Readonly<import("lowlight").Options> | null | undefined) => import("hast").Root;
|
|
15
4
|
highlightAuto: (value: string, options?: Readonly<import("lowlight").AutoOptions> | null | undefined) => import("hast").Root;
|
|
16
5
|
listLanguages: () => Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeColours.d.ts","sourceRoot":"","sources":["../src/codeColours.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"codeColours.d.ts","sourceRoot":"","sources":["../src/codeColours.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAoBrD,wBAAgB,QAAQ;wDAZhB,CAAC;0CACmB,CAAC;;;;;;;;;;;EAa5B;AAcD,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAGtE"}
|
package/dist/editor.js
CHANGED
|
@@ -344,10 +344,19 @@ import { CodeBlockLowlight } from "@tiptap/extension-code-block-lowlight";
|
|
|
344
344
|
// src/codeColours.ts
|
|
345
345
|
import { createElement } from "react";
|
|
346
346
|
import { common, createLowlight } from "lowlight";
|
|
347
|
-
var
|
|
347
|
+
var instance;
|
|
348
|
+
function lowlight() {
|
|
349
|
+
return instance ??= createLowlight(common);
|
|
350
|
+
}
|
|
348
351
|
|
|
349
352
|
// src/CodeBlockColours.ts
|
|
350
|
-
var
|
|
353
|
+
var namedOnly = {
|
|
354
|
+
highlight: (language, value) => lowlight().highlight(language, value),
|
|
355
|
+
highlightAuto: (value) => ({ type: "root", children: [{ type: "text", value }], data: { language: void 0, relevance: 0 } }),
|
|
356
|
+
listLanguages: () => lowlight().listLanguages(),
|
|
357
|
+
registered: (language) => lowlight().registered(language)
|
|
358
|
+
};
|
|
359
|
+
var CodeBlockColours = CodeBlockLowlight.configure({ lowlight: namedOnly });
|
|
351
360
|
|
|
352
361
|
// src/suggestionPopup.tsx
|
|
353
362
|
import { forwardRef, useRef as useRef2, useImperativeHandle } from "react";
|