mindcache 3.7.0 → 3.8.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/server.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MindCache } from './CloudAdapter-PLGvGjoA.mjs';
2
- export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, p as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, l as HistoryOptions, K as KeyAttributes, k as KeyEntry, g as KeyType, L as Listener, m as MindCacheCloudOptions, n as MindCacheIndexedDBOptions, f as MindCacheOptions, j as STM, k as STMEntry, h as SystemTag, q as SystemTagHelpers } from './CloudAdapter-PLGvGjoA.mjs';
1
+ import { M as MindCache } from './CloudAdapter-D6hoG13x.mjs';
2
+ export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, p as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, l as HistoryOptions, K as KeyAttributes, k as KeyEntry, g as KeyType, L as Listener, m as MindCacheCloudOptions, n as MindCacheIndexedDBOptions, f as MindCacheOptions, j as STM, k as STMEntry, h as SystemTag, q as SystemTagHelpers } from './CloudAdapter-D6hoG13x.mjs';
3
3
  import 'yjs';
4
4
 
5
5
  interface IndexedDBConfig {
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MindCache } from './CloudAdapter-PLGvGjoA.js';
2
- export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, p as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, l as HistoryOptions, K as KeyAttributes, k as KeyEntry, g as KeyType, L as Listener, m as MindCacheCloudOptions, n as MindCacheIndexedDBOptions, f as MindCacheOptions, j as STM, k as STMEntry, h as SystemTag, q as SystemTagHelpers } from './CloudAdapter-PLGvGjoA.js';
1
+ import { M as MindCache } from './CloudAdapter-D6hoG13x.js';
2
+ export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, p as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, l as HistoryOptions, K as KeyAttributes, k as KeyEntry, g as KeyType, L as Listener, m as MindCacheCloudOptions, n as MindCacheIndexedDBOptions, f as MindCacheOptions, j as STM, k as STMEntry, h as SystemTag, q as SystemTagHelpers } from './CloudAdapter-D6hoG13x.js';
3
3
  import 'yjs';
4
4
 
5
5
  interface IndexedDBConfig {
package/dist/server.js CHANGED
@@ -555,18 +555,23 @@ var MarkdownSerializer = class {
555
555
  /**
556
556
  * Export MindCache data to Markdown format.
557
557
  */
558
- static toMarkdown(mc) {
558
+ static toMarkdown(mc, options) {
559
559
  const now = /* @__PURE__ */ new Date();
560
560
  const lines = [];
561
561
  const appendixEntries = [];
562
562
  let appendixCounter = 0;
563
- lines.push("# MindCache STM Export");
563
+ const name = options?.name || "MindCache Export";
564
+ lines.push(`# ${name}`);
564
565
  lines.push("");
566
+ if (options?.description) {
567
+ lines.push(options.description);
568
+ lines.push("");
569
+ }
565
570
  lines.push(`Export Date: ${now.toISOString().split("T")[0]}`);
566
571
  lines.push("");
567
572
  lines.push("---");
568
573
  lines.push("");
569
- lines.push("## STM Entries");
574
+ lines.push("## Keys & Values");
570
575
  lines.push("");
571
576
  const sortedKeys = mc.getSortedKeys();
572
577
  sortedKeys.forEach((key) => {
@@ -574,9 +579,17 @@ var MarkdownSerializer = class {
574
579
  const value = mc.get_value(key);
575
580
  lines.push(`### ${key}`);
576
581
  const entryType = attributes?.type || "text";
577
- lines.push(`- **Type**: \`${entryType}\``);
578
- lines.push(`- **System Tags**: \`${attributes?.systemTags?.join(", ") || "none"}\``);
579
- lines.push(`- **Z-Index**: \`${attributes?.zIndex ?? 0}\``);
582
+ if (entryType !== "text") {
583
+ lines.push(`- **Type**: \`${entryType}\``);
584
+ }
585
+ const systemTags = attributes?.systemTags;
586
+ if (systemTags && systemTags.length > 0) {
587
+ lines.push(`- **System Tags**: \`${systemTags.join(", ")}\``);
588
+ }
589
+ const zIndex = attributes?.zIndex ?? 0;
590
+ if (zIndex !== 0) {
591
+ lines.push(`- **Z-Index**: \`${zIndex}\``);
592
+ }
580
593
  if (attributes?.contentTags && attributes.contentTags.length > 0) {
581
594
  lines.push(`- **Tags**: \`${attributes.contentTags.join("`, `")}\``);
582
595
  }
@@ -755,7 +768,7 @@ var MarkdownSerializer = class {
755
768
  mc.set_value(currentKey, currentValue.trim(), currentAttributes);
756
769
  }
757
770
  const hasParsedKeys = lines.some((line) => line.startsWith("### ") && !line.startsWith("### Appendix"));
758
- const isSTMExport = markdown.includes("# MindCache STM Export") || markdown.includes("## STM Entries");
771
+ const isSTMExport = markdown.includes("# MindCache STM Export") || markdown.includes("## STM Entries") || markdown.includes("## Keys & Values") || markdown.includes("# MindCache Export");
759
772
  if (!hasParsedKeys && !isSTMExport && markdown.trim().length > 0) {
760
773
  mc.set_value("imported_content", markdown.trim(), {
761
774
  type: "text",
@@ -883,7 +896,7 @@ var MarkdownSerializer = class {
883
896
  }
884
897
  saveEntry();
885
898
  const hasParsedKeys = lines.some((line) => line.startsWith("### ") && !line.startsWith("### Appendix"));
886
- const isSTMExport = markdown.includes("# MindCache STM Export") || markdown.includes("## STM Entries");
899
+ const isSTMExport = markdown.includes("# MindCache STM Export") || markdown.includes("## STM Entries") || markdown.includes("## Keys & Values") || markdown.includes("# MindCache Export");
887
900
  if (!hasParsedKeys && !isSTMExport && markdown.trim().length > 0) {
888
901
  result["imported_content"] = {
889
902
  value: markdown.trim(),
@@ -1614,7 +1627,7 @@ var MindCache = class {
1614
1627
  listeners = {};
1615
1628
  globalListeners = [];
1616
1629
  // Metadata
1617
- version = "3.6.0";
1630
+ version = "3.8.0";
1618
1631
  // Internal flag to prevent sync loops when receiving remote updates
1619
1632
  // (Less critical with Yjs but kept for API compat)
1620
1633
  normalizeSystemTags(tags) {
@@ -2709,9 +2722,10 @@ var MindCache = class {
2709
2722
  }
2710
2723
  /**
2711
2724
  * Export to Markdown format.
2725
+ * @param options Optional name and description for the export
2712
2726
  */
2713
- toMarkdown() {
2714
- return MarkdownSerializer.toMarkdown(this);
2727
+ toMarkdown(options) {
2728
+ return MarkdownSerializer.toMarkdown(this, options);
2715
2729
  }
2716
2730
  /**
2717
2731
  * Import from Markdown format.