@fluid-topics/ft-code-highlight 1.2.11

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.
@@ -0,0 +1,4 @@
1
+ export interface FtCodeHighlightProperties {
2
+ language?: string;
3
+ theme?: string;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const FtCodeHighlightCssVariables: {
2
+ colorSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
3
+ };
4
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,13 @@
1
+ import { css } from "lit";
2
+ import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
3
+ export const FtCodeHighlightCssVariables = {
4
+ colorSurface: FtCssVariableFactory.extend("--ft-code-highlight-background-color", "", designSystemVariables.colorSurface),
5
+ };
6
+ // language=CSS
7
+ export const styles = css `
8
+ .hidden { display: none; }
9
+ [part="code"] {
10
+ background-color: ${FtCodeHighlightCssVariables.colorSurface};
11
+ margin: 0;
12
+ }
13
+ `;
@@ -0,0 +1,3 @@
1
+ export * from "./ft-code-highlight.styles";
2
+ export * from "./ft-code-highlight.properties";
3
+ export * from "./ft-code-highlight";
package/build/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { customElement } from "@fluid-topics/ft-wc-utils";
2
+ import { FtCodeHighlight } from "./ft-code-highlight";
3
+ export * from "./ft-code-highlight.styles";
4
+ export * from "./ft-code-highlight.properties";
5
+ export * from "./ft-code-highlight";
6
+ customElement("ft-code-highlight")(FtCodeHighlight);
@@ -0,0 +1,6 @@
1
+ import { FtServiceWithCache } from "@fluid-topics/ft-app-context";
2
+ export declare class FtCodeHighlightService extends FtServiceWithCache {
3
+ coreHighlight(): string;
4
+ languageHighlight(): string;
5
+ styleHighlight(): string;
6
+ }
@@ -0,0 +1,17 @@
1
+ import { FtServiceWithCache } from "@fluid-topics/ft-app-context";
2
+ const ROOT_HIGHLIGHT = "/assets/scripts/highlightjs";
3
+ const CORE_HIGHLIGHT = `${ROOT_HIGHLIGHT}/core.min.js`;
4
+ export class FtCodeHighlightService extends FtServiceWithCache {
5
+ coreHighlight() {
6
+ var _a;
7
+ return (_a = this.api) === null || _a === void 0 ? void 0 : _a.makeAbsolute(CORE_HIGHLIGHT);
8
+ }
9
+ languageHighlight() {
10
+ var _a;
11
+ return (_a = this.api) === null || _a === void 0 ? void 0 : _a.makeAbsolute(`${ROOT_HIGHLIGHT}/languages`);
12
+ }
13
+ styleHighlight() {
14
+ var _a;
15
+ return (_a = this.api) === null || _a === void 0 ? void 0 : _a.makeAbsolute(`${ROOT_HIGHLIGHT}/styles`);
16
+ }
17
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@fluid-topics/ft-code-highlight",
3
+ "version": "1.2.11",
4
+ "description": "Code aware highlighting",
5
+ "keywords": [
6
+ "Lit"
7
+ ],
8
+ "author": "Fluid Topics <devtopics@antidot.net>",
9
+ "license": "ISC",
10
+ "main": "build/index.js",
11
+ "web": "build/ft-code-highlight.min.js",
12
+ "typings": "build/index",
13
+ "files": [
14
+ "build/**/*.js",
15
+ "build/**/*.ts"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
+ },
21
+ "dependencies": {
22
+ "@fluid-topics/ft-wc-utils": "1.2.11",
23
+ "highlight.js": "^11.11.1",
24
+ "lit": "3.1.0"
25
+ },
26
+ "gitHead": "e064cf26299976a55c5adb3c602fed2dc076557b"
27
+ }