@diagrammo/dgmo 0.8.16 → 0.8.17
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/cli.cjs +71 -71
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/sharing.ts +4 -3
package/dist/index.cjs
CHANGED
|
@@ -31925,13 +31925,12 @@ init_colors();
|
|
|
31925
31925
|
init_palettes();
|
|
31926
31926
|
|
|
31927
31927
|
// src/sharing.ts
|
|
31928
|
-
var import_lz_string =
|
|
31929
|
-
var { compressToEncodedURIComponent, decompressFromEncodedURIComponent } = import_lz_string.default;
|
|
31928
|
+
var import_lz_string = require("lz-string");
|
|
31930
31929
|
var DEFAULT_BASE_URL = "https://online.diagrammo.app";
|
|
31931
31930
|
var COMPRESSED_SIZE_LIMIT = 8192;
|
|
31932
31931
|
function encodeDiagramUrl(dsl, options) {
|
|
31933
31932
|
const baseUrl = options?.baseUrl ?? DEFAULT_BASE_URL;
|
|
31934
|
-
const compressed = compressToEncodedURIComponent(dsl);
|
|
31933
|
+
const compressed = (0, import_lz_string.compressToEncodedURIComponent)(dsl);
|
|
31935
31934
|
const byteSize = new TextEncoder().encode(compressed).byteLength;
|
|
31936
31935
|
if (byteSize > COMPRESSED_SIZE_LIMIT) {
|
|
31937
31936
|
return {
|
|
@@ -32002,7 +32001,7 @@ function decodeDiagramUrl(hash) {
|
|
|
32002
32001
|
}
|
|
32003
32002
|
if (!payload) return { dsl: "", viewState, filename };
|
|
32004
32003
|
try {
|
|
32005
|
-
const result = decompressFromEncodedURIComponent(payload);
|
|
32004
|
+
const result = (0, import_lz_string.decompressFromEncodedURIComponent)(payload);
|
|
32006
32005
|
return { dsl: result ?? "", viewState, filename };
|
|
32007
32006
|
} catch {
|
|
32008
32007
|
return { dsl: "", viewState, filename };
|