@takeshape/util 12.1.7 → 12.2.2

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.
@@ -10,7 +10,6 @@ export * from './draftjs.ts';
10
10
  export * from './draftjs-templates.ts';
11
11
  export * from './empty.ts';
12
12
  export * from './get-image-url.ts';
13
- export * from './highlight-code.ts';
14
13
  export * from './http.ts';
15
14
  export * from './map.ts';
16
15
  export * from './memoize.ts';
@@ -10,7 +10,6 @@ export * from "./draftjs.js";
10
10
  export * from "./draftjs-templates.js";
11
11
  export * from "./empty.js";
12
12
  export * from "./get-image-url.js";
13
- export * from "./highlight-code.js";
14
13
  export * from "./http.js";
15
14
  export * from "./map.js";
16
15
  export * from "./memoize.js";
@@ -22,9 +22,5 @@ export declare function imageTemplate(applyPrefix: (str: string) => string, data
22
22
  export declare function imageTemplateMdx(applyPrefix: (str: string) => string, data: Record<string, string>): string;
23
23
  export declare function oembedTemplate(applyPrefix: (str: string) => string, data: Record<string, string>): string;
24
24
  export declare function oembedTemplateMdx(applyPrefix: (str: string) => string, data: Record<string, string>): string;
25
- export declare function codeTemplate(applyPrefix: (str: string) => string, data: {
26
- text: string;
27
- lang?: string;
28
- }): string;
29
25
  export declare function jsonTemplate(template: unknown, context: Record<string, string>): unknown;
30
26
  export {};
@@ -5,7 +5,6 @@ import { getImageUrl } from '@takeshape/routing';
5
5
  */
6
6
  import classnames from 'classnames';
7
7
  import _escape from 'lodash/escape.js';
8
- import { highlightCode } from "./highlight-code.js";
9
8
  import { isRecord } from "./types.js";
10
9
  export function getApplyPrefix(prefix) {
11
10
  return (className) => (className ? prefix + className : '');
@@ -65,12 +64,6 @@ export function oembedTemplate(applyPrefix, data) {
65
64
  export function oembedTemplateMdx(applyPrefix, data) {
66
65
  return renderMdx(applyPrefix('Oembed'), ['url', 'author_name', 'author_url', 'width', 'height', 'type', 'cache_age', 'provider_name', 'version'], data, data.html);
67
66
  }
68
- export function codeTemplate(applyPrefix, data) {
69
- const { text, lang } = data;
70
- const code = highlightCode(text, lang);
71
- const langClass = lang ? ` class="${applyPrefix(`language-${lang}`)}"` : '';
72
- return `<pre><code${langClass}>${code}</code></pre>`;
73
- }
74
67
  export function jsonTemplate(template, context) {
75
68
  const renderTemplate = (template) => {
76
69
  return template.replace(/{{(\w+)}}/g, (_, name) => context[name] ?? '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/util",
3
- "version": "12.1.7",
3
+ "version": "12.2.2",
4
4
  "description": "Shared utilities",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -45,8 +45,7 @@
45
45
  "tiny-invariant": "1.3.3",
46
46
  "uint8array-extras": "1.4.0",
47
47
  "url-parse": "1.5.3",
48
- "@takeshape/prism": "12.1.7",
49
- "@takeshape/routing": "12.1.7"
48
+ "@takeshape/routing": "12.2.2"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@types/classnames": "2.2.11",
@@ -1,2 +0,0 @@
1
- import { highlightCode } from '@takeshape/prism';
2
- export { highlightCode };
@@ -1,2 +0,0 @@
1
- import { highlightCode } from '@takeshape/prism';
2
- export { highlightCode };