@zsviczian/excalidraw 0.17.1-obsidian-58-fonts-2 → 0.17.6

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,28 +10,28 @@
10
10
  /* WARN: The following content is replaced during excalidraw-app build */
11
11
  @font-face {
12
12
  font-family: "Assistant";
13
- src: url(excalidraw-assets-dev/Assistant-Regular.woff2) format("woff2");
13
+ src: url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-Regular.woff2) format("woff2");
14
14
  font-weight: 400;
15
15
  style: normal;
16
16
  display: swap;
17
17
  }
18
18
  @font-face {
19
19
  font-family: "Assistant";
20
- src: url(excalidraw-assets-dev/Assistant-Medium.woff2) format("woff2");
20
+ src: url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-Medium.woff2) format("woff2");
21
21
  font-weight: 500;
22
22
  style: normal;
23
23
  display: swap;
24
24
  }
25
25
  @font-face {
26
26
  font-family: "Assistant";
27
- src: url(excalidraw-assets-dev/Assistant-SemiBold.woff2) format("woff2");
27
+ src: url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-SemiBold.woff2) format("woff2");
28
28
  font-weight: 600;
29
29
  style: normal;
30
30
  display: swap;
31
31
  }
32
32
  @font-face {
33
33
  font-family: "Assistant";
34
- src: url(excalidraw-assets-dev/Assistant-Bold.woff2) format("woff2");
34
+ src: url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-Bold.woff2) format("woff2");
35
35
  font-weight: 700;
36
36
  style: normal;
37
37
  display: swap;
@@ -1,5 +1,5 @@
1
1
 
2
- @font-face{font-family:"Assistant";src:url(excalidraw-assets/Assistant-Regular.woff2) format("woff2");font-weight:400;style:normal;display:swap}@font-face{font-family:"Assistant";src:url(excalidraw-assets/Assistant-Medium.woff2) format("woff2");font-weight:500;style:normal;display:swap}@font-face{font-family:"Assistant";src:url(excalidraw-assets/Assistant-SemiBold.woff2) format("woff2");font-weight:600;style:normal;display:swap}@font-face{font-family:"Assistant";src:url(excalidraw-assets/Assistant-Bold.woff2) format("woff2");font-weight:700;style:normal;display:swap}
2
+ @font-face{font-family:"Assistant";src:url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-Regular.woff2) format("woff2");font-weight:400;style:normal;display:swap}@font-face{font-family:"Assistant";src:url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-Medium.woff2) format("woff2");font-weight:500;style:normal;display:swap}@font-face{font-family:"Assistant";src:url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-SemiBold.woff2) format("woff2");font-weight:600;style:normal;display:swap}@font-face{font-family:"Assistant";src:url(https://unpkg.com/@zsviczian/excalidraw@0.17.1-obsidian-58/dist/excalidraw-assets/Assistant-Bold.woff2) format("woff2");font-weight:700;style:normal;display:swap}
3
3
  .excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{animation:rotate 1.6s linear infinite;animation-delay:var(--spinner-delay);transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}
4
4
  .excalidraw .dialog-mermaid-title{margin-block:.25rem;font-size:1.25rem;font-weight:700;padding-inline:2.5rem}
5
5
  :export{themeFilter:invert(93%) hue-rotate(180deg);rightSidebarWidth:302px}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: var(--color-gray-20);--dropdown-icon: url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"292.4\" height=\"292.4\" viewBox=\"0 0 292 292\"><path d=\"M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z\"/></svg>");--focus-highlight-color: #a5d8ff;--icon-fill-color: var(--color-on-surface);--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: #ffffff;--keybinding-color: var(--color-gray-40);--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: var(--island-bg-color);--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--select-highlight-color: #339af0;--shadow-island: 0px 0px 0.9310142993927002px 0px rgba(0, 0, 0, 0.17), 0px 0px 3.1270833015441895px 0px rgba(0, 0, 0, 0.08), 0px 7px 14px 0px rgba(0, 0, 0, 0.05);--button-hover-bg: var(--color-surface-high);--button-active-bg: var(--color-surface-high);--button-active-border: var(--color-brand-active);--default-border-color: var(--color-surface-high);--default-button-size: 2rem;--default-icon-size: 1rem;--lg-button-size: 2.25rem;--lg-icon-size: 1rem;--editor-container-padding: 1rem;--scrollbar-thumb: var(--button-gray-2);--scrollbar-thumb-hover: var(--button-gray-3);--modal-shadow: 0px 100px 80px rgba(0, 0, 0, 0.07), 0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0503198), 0px 22.3363px 17.869px rgba(0, 0, 0, 0.0417275), 0px 12.5216px 10.0172px rgba(0, 0, 0, 0.035), 0px 6.6501px 5.32008px rgba(0, 0, 0, 0.0282725), 0px 2.76726px 2.21381px rgba(0, 0, 0, 0.0196802);--avatar-border-color: var(--color-gray-20);--sidebar-shadow: 0px 100px 80px rgba(0, 0, 0, 0.07), 0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0503198), 0px 22.3363px 17.869px rgba(0, 0, 0, 0.0417275), 0px 12.5216px 10.0172px rgba(0, 0, 0, 0.035), 0px 6.6501px 5.32008px rgba(0, 0, 0, 0.0282725), 0px 2.76726px 2.21381px rgba(0, 0, 0, 0.0196802);--sidebar-border-color: var(--color-surface-high);--sidebar-bg-color: var(--island-bg-color);--library-dropdown-shadow: 0px 15px 6px rgba(0, 0, 0, 0.01), 0px 8px 5px rgba(0, 0, 0, 0.05), 0px 4px 4px rgba(0, 0, 0, 0.09), 0px 1px 2px rgba(0, 0, 0, 0.1), 0px 0px 0px rgba(0, 0, 0, 0.1);--space-factor: 0.25rem;--text-primary-color: var(--color-on-surface);--color-selection: #6965db;--color-icon-white: #ffffff;--color-primary: #6965db;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;--color-primary-light: #e3e2fe;--color-primary-light-darker: #d7d5ff;--color-primary-hover: #5753d0;--color-gray-10: #f5f5f5;--color-gray-20: #ebebeb;--color-gray-30: #d6d6d6;--color-gray-40: #b8b8b8;--color-gray-50: #999999;--color-gray-60: #7a7a7a;--color-gray-70: #5c5c5c;--color-gray-80: #3d3d3d;--color-gray-85: #242424;--color-gray-90: #1e1e1e;--color-gray-100: #121212;--color-disabled: var(--color-gray-40);--color-warning: #fceeca;--color-warning-dark: #f5c354;--color-warning-darker: #f3ab2c;--color-warning-darkest: #ec8b14;--color-text-warning: var(--text-primary-color);--color-danger: #db6965;--color-danger-dark: #db6965;--color-danger-darker: #d65550;--color-danger-darkest: #d1413c;--color-danger-text: black;--color-danger-background: #fff0f0;--color-danger-icon-background: #ffdad6;--color-danger-color: #700000;--color-danger-icon-color: #700000;--color-warning-background: var(--color-warning);--color-warning-icon-background: var(--color-warning-dark);--color-warning-color: var(--text-primary-color);--color-warning-icon-color: var(--text-primary-color);--color-muted: var(--color-gray-30);--color-muted-darker: var(--color-gray-60);--color-muted-darkest: var(--color-gray-100);--color-muted-background: var(--color-gray-80);--color-muted-background-darker: var(--color-gray-100);--color-promo: var(--color-primary);--color-success: #cafccc;--color-success-darker: #bafabc;--color-success-darkest: #a5eba8;--color-success-text: #268029;--color-success-contrast: #65bb6a;--color-success-contrast-hover: #6bcf70;--color-success-contrast-active: #6edf74;--color-logo-icon: var(--color-primary);--color-logo-text: #190064;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem;--color-surface-high: #f1f0ff;--color-surface-mid: #f2f2f7;--color-surface-low: #ececf4;--color-surface-lowest: #ffffff;--color-on-surface: #1b1b1f;--color-brand-hover: #5753d0;--color-on-primary-container: #030064;--color-surface-primary-container: #e0dfff;--color-brand-active: #4440bf;--color-border-outline: #767680;--color-border-outline-variant: #c5c5d0;--color-surface-primary-container: #e0dfff;--color-badge: #0b6513;--background-color-badge: #d3ffd2}@media screen and (min-device-width: 1921px){.excalidraw{--lg-button-size: 2.5rem;--lg-icon-size: 1.25rem;--default-button-size: 2.25rem;--default-icon-size: 1.25rem}}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: var(--color-gray-80);--dropdown-icon: url("data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"292.4\" height=\"292.4\" viewBox=\"0 0 292 292\"><path fill=\"%23ced4da\" d=\"M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z\"/></svg>");--focus-highlight-color: #228be6;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: #232329;--keybinding-color: var(--color-gray-60);--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #4dabf7;--shadow-island: 0px 0px 0.9310142993927002px 0px rgba(0, 0, 0, 0.17), 0px 0px 3.1270833015441895px 0px rgba(0, 0, 0, 0.08), 0px 7px 14px 0px rgba(0, 0, 0, 0.05);--modal-shadow: 0px 100px 80px rgba(0, 0, 0, 0.07), 0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0503198), 0px 22.3363px 17.869px rgba(0, 0, 0, 0.0417275), 0px 12.5216px 10.0172px rgba(0, 0, 0, 0.035), 0px 6.6501px 5.32008px rgba(0, 0, 0, 0.0282725), 0px 2.76726px 2.21381px rgba(0, 0, 0, 0.0196802);--avatar-border-color: var(--color-gray-85);--scrollbar-thumb: #343a40;--scrollbar-thumb-hover: #495057;--color-selection: #3530c4;--color-icon-white: var(--color-gray-90);--color-primary: #a8a5ff;--color-primary-darker: #b2aeff;--color-primary-darkest: #beb9ff;--color-primary-light: #4f4d6f;--color-primary-light-darker: #43415e;--color-primary-hover: #bbb8ff;--color-disabled: var(--color-gray-70);--color-text-warning: var(--color-gray-80);--color-danger: #ffa8a5;--color-danger-dark: #672120;--color-danger-darker: #8f2625;--color-danger-darkest: #ac2b29;--color-danger-text: #fbcbcc;--color-danger-background: #fbcbcc;--color-danger-icon-background: #672120;--color-danger-color: #261919;--color-danger-icon-color: #fbcbcc;--color-warning-background: var(--color-warning);--color-warning-icon-background: var(--color-warning-dark);--color-warning-color: var(--color-gray-80);--color-warning-icon-color: var(--color-gray-80);--color-muted: var(--color-gray-80);--color-muted-darker: var(--color-gray-60);--color-muted-darkest: var(--color-gray-20);--color-muted-background: var(--color-gray-40);--color-muted-background-darker: var(--color-gray-20);--color-logo-text: #e2dfff;--color-surface-high: hsl(245, 10%, 21%);--color-surface-low: hsl(240, 8%, 15%);--color-surface-mid: hsl(240 6% 10%);--color-surface-lowest: hsl(0, 0%, 7%);--color-on-surface: #e3e3e8;--color-brand-hover: #bbb8ff;--color-on-primary-container: #e0dfff;--color-surface-primary-container: #403e6a;--color-brand-active: #d0ccff;--color-border-outline: #8e8d9c;--color-border-outline-variant: #46464f;--color-surface-primary-container: #403e6a}.excalidraw .excalidraw-button{display:flex;justify-content:center;align-items:center;padding:.625rem;width:var(--button-width, var(--default-button-size));height:var(--button-height, var(--default-button-size));box-sizing:border-box;border-width:1px;border-style:solid;border-color:var(--button-border, var(--default-border-color));border-radius:var(--border-radius-lg);cursor:pointer;background-color:var(--button-bg, var(--island-bg-color));color:var(--button-color, var(--color-on-surface));font-family:var(--ui-font)}.excalidraw .excalidraw-button svg{width:var(--button-width, var(--lg-icon-size));height:var(--button-height, var(--lg-icon-size))}.excalidraw .excalidraw-button:hover{background-color:var(--button-hover-bg, var(--island-bg-color));border-color:var(--button-hover-border, var(--button-border, var(--default-border-color)));color:var(--button-hover-color, var(--button-color, var(--text-primary-color, inherit)))}.excalidraw .excalidraw-button:active{background-color:var(--button-active-bg, var(--island-bg-color));border-color:var(--button-active-border, var(--color-primary-darkest))}.excalidraw .excalidraw-button.active{background-color:var(--button-selected-bg, var(--color-surface-primary-container));border-color:var(--button-selected-border, var(--color-surface-primary-container))}.excalidraw .excalidraw-button.active:hover{background-color:var(--button-selected-hover-bg, var(--color-surface-primary-container))}.excalidraw .excalidraw-button.active svg{color:var(--button-color, var(--color-on-primary-container))}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.17.1-obsidian-58-fonts-2",
3
+ "version": "0.17.6",
4
4
  "main": "main.js",
5
5
  "types": "types/excalidraw/index.d.ts",
6
6
  "files": [
@@ -39,7 +39,7 @@ export declare class Fonts {
39
39
  * Load font faces for passed elements - use when the scene is unavailable (i.e. export).
40
40
  */
41
41
  static loadElementsFonts: (elements: readonly ExcalidrawElement[]) => Promise<FontFace[]>;
42
- private static loadFontFaces;
42
+ static loadFontFaces(fontFamilies: Array<ExcalidrawTextElement["fontFamily"]>): Promise<FontFace[]>;
43
43
  /**
44
44
  * WARN: should be called just once on init, even across multiple instances.
45
45
  */
@@ -49,7 +49,7 @@ export declare class Fonts {
49
49
  */
50
50
  getSceneFamilies: () => number[];
51
51
  private static getAllFamilies;
52
- private static getElementsFamilies;
52
+ static getElementsFamilies(elements: ReadonlyArray<ExcalidrawElement>): Array<ExcalidrawTextElement["fontFamily"]>;
53
53
  }
54
54
  /**
55
55
  * Register a new font.
@@ -27,7 +27,8 @@ registerLocalFont, //zsviczian
27
27
  getFontFamilies, //zsviczian
28
28
  getFontFamilyString, //zsviczian
29
29
  registerFontsInCSS, //zsviczian
30
- getCSSFontDefinition, } from "../utils/export";
30
+ getCSSFontDefinition, //zsviczian
31
+ loadSceneFonts, } from "../utils/export";
31
32
  export { refreshTextDimensions } from "./element/newElement";
32
33
  export { getContainerElement } from "./element/textElement";
33
34
  export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
@@ -1,3 +1,4 @@
1
+ import { NonDeletedExcalidrawElement } from "./element/types";
1
2
  import type { FontMetadata } from "./fonts/metadata";
2
3
  export declare let hostPlugin: any;
3
4
  export declare function destroyObsidianUtils(): void;
@@ -16,3 +17,5 @@ export declare function registerLocalFont(fontMetrics: FontMetadata & {
16
17
  export declare function getFontFamilies(): string[];
17
18
  export declare function registerFontsInCSS(): Promise<void>;
18
19
  export declare function getCSSFontDefinition(fontFamily: number): Promise<string>;
20
+ export declare function loadSceneFonts(elements: NonDeletedExcalidrawElement[]): Promise<void>;
21
+ export declare function fetchFontFromVault(url: string | URL): Promise<ArrayBuffer | undefined>;
@@ -41,4 +41,4 @@ export { getLineHeight } from "../excalidraw/fonts/index";
41
41
  export { getFontString, getFontFamilyString } from "../excalidraw/utils";
42
42
  export { getBoundTextMaxWidth } from "../excalidraw/element/textElement";
43
43
  export { mermaidToExcalidraw } from "../excalidraw/components/TTDDialog/MermaidToExcalidraw";
44
- export { destroyObsidianUtils, registerLocalFont, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, } from "../excalidraw/obsidianUtils";
44
+ export { destroyObsidianUtils, registerLocalFont, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, } from "../excalidraw/obsidianUtils";