@aiquants/markdown-explorer 0.35.0 → 0.36.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +31 -2
  3. package/dist/{EditSurface-CLG70Vnn.cjs → EditSurface-B70iRFkG.cjs} +1 -1
  4. package/dist/{EditSurface-D2j1kCEE.js → EditSurface-BCFJRyIM.js} +5 -5
  5. package/dist/{ExplorerSplit-D_0VohOv.cjs → ExplorerSplit-BNrHrIus.cjs} +1 -1
  6. package/dist/{ExplorerSplit-CfP1smbT.js → ExplorerSplit-Bgccz2nm.js} +77 -77
  7. package/dist/{MultiLayout-CxV5SI7f.cjs → MultiLayout-Bo9LAXiY.cjs} +1 -1
  8. package/dist/{MultiLayout-BeJ5Lubb.js → MultiLayout-Dy5TIC2t.js} +4 -4
  9. package/dist/{NativeScrollBar-RWXpVhbI.cjs → NativeScrollBar-Bj-LKej0.cjs} +1 -1
  10. package/dist/{NativeScrollBar-BM5NULzg.js → NativeScrollBar-DpZMYhmf.js} +2 -2
  11. package/dist/TreeLayout-DsSKW_Qj.js +103 -0
  12. package/dist/TreeLayout-T8sc_wg7.cjs +1 -0
  13. package/dist/core/config.d.cts +6 -0
  14. package/dist/core/config.d.ts +6 -0
  15. package/dist/core/contracts.d.cts +21 -0
  16. package/dist/core/contracts.d.ts +21 -0
  17. package/dist/core/dataRoute.d.cts +5 -1
  18. package/dist/core/dataRoute.d.ts +5 -1
  19. package/dist/core/documentId.d.cts +6 -0
  20. package/dist/core/documentId.d.ts +6 -0
  21. package/dist/core/labels.d.cts +10 -0
  22. package/dist/core/labels.d.ts +10 -0
  23. package/dist/core/location.d.cts +21 -0
  24. package/dist/core/location.d.ts +21 -0
  25. package/dist/explorerCore-B3RGmMG6.js +1083 -0
  26. package/dist/explorerCore-CUkyKtm8.cjs +1 -0
  27. package/dist/{index-C1YMH-yI.js → index-D0l_BJqb.js} +2536 -2372
  28. package/dist/index-lpL7GltU.cjs +18 -0
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.d.cts +2 -1
  31. package/dist/index.d.ts +2 -1
  32. package/dist/index.js +38 -33
  33. package/dist/location-Dh6K-y7w.js +761 -0
  34. package/dist/location-DrOP6t1F.cjs +1 -0
  35. package/dist/{merge-Bb_HpPhe.js → merge-BwcqBd4c.js} +1 -1
  36. package/dist/{merge-DQUYEGCx.cjs → merge-Dckw7r9T.cjs} +1 -1
  37. package/dist/ownUrls-BTPGNhBt.cjs +1 -0
  38. package/dist/ownUrls-DD0cSCsF.js +409 -0
  39. package/dist/{sanitizeJob-BYRk17nr.js → sanitizeJob-BYqzjFJC.js} +1 -1
  40. package/dist/{sanitizeJob-Cs9o3Vpl.cjs → sanitizeJob-CudE1RUP.cjs} +1 -1
  41. package/dist/{sanitizePolicy-CiQfnxyd.cjs → sanitizePolicy-C-ehd0J_.cjs} +1 -1
  42. package/dist/{sanitizePolicy-CEMdaLUB.js → sanitizePolicy-DAPnUUVm.js} +1 -1
  43. package/dist/sanitizeWorker.cjs +1 -1
  44. package/dist/sanitizeWorker.js +3 -3
  45. package/dist/{sanitizerService-KWXv7bPm.js → sanitizerService-B8v4ap9t.js} +1 -1
  46. package/dist/{sanitizerService-BY4CPCoA.cjs → sanitizerService-DomN7lwC.cjs} +1 -1
  47. package/dist/server/errors.d.cts +1 -1
  48. package/dist/server/errors.d.ts +1 -1
  49. package/dist/server/ports.d.cts +19 -0
  50. package/dist/server/ports.d.ts +19 -0
  51. package/dist/server.cjs +1 -1
  52. package/dist/server.d.cts +1 -1
  53. package/dist/server.d.ts +1 -1
  54. package/dist/server.js +6 -6
  55. package/dist/serverBrowser.cjs +1 -1
  56. package/dist/serverBrowser.js +3 -3
  57. package/dist/serverCore.cjs +1 -1
  58. package/dist/serverCore.d.cts +1 -1
  59. package/dist/serverCore.d.ts +1 -1
  60. package/dist/serverCore.js +4 -4
  61. package/dist/{tapScrollCircle-DdX0Wri0.cjs → tapScrollCircle-DyLInGck.cjs} +1 -1
  62. package/dist/{tapScrollCircle-BEydRn0y.js → tapScrollCircle-smKLgRa2.js} +1 -1
  63. package/dist/testing.cjs +1 -1
  64. package/dist/testing.d.cts +5 -0
  65. package/dist/testing.d.ts +5 -0
  66. package/dist/testing.js +80 -2
  67. package/dist/{useSplitPersistence-B2Fj508K.cjs → useSplitPersistence-BUa_KMsV.cjs} +1 -1
  68. package/dist/{useSplitPersistence-Fkqak8G8.js → useSplitPersistence-pnb21dsr.js} +1 -1
  69. package/docs/behavior/dom-hooks.md +3 -1
  70. package/docs/behavior/security.md +23 -2
  71. package/docs/behavior/url-contract.md +26 -0
  72. package/package.json +2 -2
  73. package/dist/TreeLayout-AxLw-36S.js +0 -103
  74. package/dist/TreeLayout-Bg2YH-EY.cjs +0 -1
  75. package/dist/explorerCore-DLpDuSev.js +0 -998
  76. package/dist/explorerCore-DYrxS9ez.cjs +0 -1
  77. package/dist/index-LQWQfpAf.cjs +0 -18
  78. package/dist/location--KvTA0Ri.js +0 -726
  79. package/dist/location-D8DyDkuA.cjs +0 -1
  80. package/dist/ownUrls-B259RGgd.cjs +0 -1
  81. package/dist/ownUrls-Dh5g6ZJi.js +0 -370
package/dist/testing.d.ts CHANGED
@@ -3,4 +3,9 @@ export type DenyVector = {
3
3
  readonly path: string;
4
4
  readonly expect: boolean;
5
5
  };
6
+ export type DocumentIdVector = {
7
+ readonly written: string;
8
+ readonly canonical: string | null;
9
+ };
6
10
  export declare const denyVectors: () => readonly DenyVector[];
11
+ export declare const documentIdVectors: () => readonly DocumentIdVector[];
package/dist/testing.js CHANGED
@@ -1,4 +1,82 @@
1
- const a = /* @__PURE__ */ JSON.parse('[{"pattern":".env*","path":".env","expect":true},{"pattern":".env*","path":"apps/web/.env.production","expect":true},{"pattern":".env*","path":".envrc","expect":true},{"pattern":".env*","path":".env~","expect":true},{"pattern":".env*","path":".env-old","expect":true},{"pattern":".env*","path":".env_backup","expect":true},{"pattern":".env*","path":"docs/environment.md","expect":false},{"pattern":".env*","path":"docs/prod.env","expect":false},{"pattern":"*.env","path":"prod.env","expect":true},{"pattern":"*.env","path":"config/staging.env","expect":true},{"pattern":"*.env","path":"prod.env.bak","expect":false},{"pattern":"*.env","path":"environment.md","expect":false},{"pattern":"*.env.*","path":"prod.env.bak","expect":true},{"pattern":"*.env.*","path":"config/deploy.env.production","expect":true},{"pattern":"*.env.*","path":"prod.env","expect":false},{"pattern":"*.env.*","path":"prod.environment.md","expect":false},{"pattern":"*.env~*","path":"prod.env~","expect":true},{"pattern":"*.env~*","path":"config/prod.env~1","expect":true},{"pattern":"*.env~*","path":"prod.env","expect":false},{"pattern":"*.env-*","path":"prod.env-old","expect":true},{"pattern":"*.env-*","path":"config/app.env-2026","expect":true},{"pattern":"*.env-*","path":"my-env-file.md","expect":false},{"pattern":"*.env_*","path":"prod.env_backup","expect":true},{"pattern":"*.env_*","path":"config/app.env_local","expect":true},{"pattern":"*.env_*","path":"my_env_file.md","expect":false},{"pattern":"*.env#*","path":"#prod.env#","expect":true},{"pattern":"*.env#*","path":"config/prod.env#1","expect":true},{"pattern":"*.env#*","path":"prod.env","expect":false},{"pattern":".git","path":".git/config","expect":true},{"pattern":".git","path":"sub/.git/HEAD","expect":true},{"pattern":".git","path":".github/workflows/ci.yml","expect":false},{"pattern":".git","path":".gitignore","expect":false},{"pattern":".git-credentials","path":".git-credentials","expect":true},{"pattern":".git-credentials","path":"home/.git-credentials","expect":true},{"pattern":".git-credentials","path":"git-credentials","expect":false},{"pattern":".svn","path":".svn/entries","expect":true},{"pattern":".svn","path":"svn/entries","expect":false},{"pattern":".hg","path":".hg/hgrc","expect":true},{"pattern":".hg","path":".hgignore","expect":false},{"pattern":"node_modules","path":"node_modules/pkg/index.js","expect":true},{"pattern":"node_modules","path":"packages/a/node_modules/b/README.md","expect":true},{"pattern":"node_modules","path":"docs/node_modules_guide.md","expect":false},{"pattern":"secrets","path":"secrets/api.md","expect":true},{"pattern":"secrets","path":"config/secrets/prod.json","expect":true},{"pattern":"secrets","path":"docs/secrets-overview.md","expect":false},{"pattern":".secrets","path":".secrets/key","expect":true},{"pattern":".secrets","path":"app/.secrets","expect":true},{"pattern":".secrets","path":".secrets.md","expect":false},{"pattern":"secrets.json","path":"secrets.json","expect":true},{"pattern":"secrets.json","path":"config/secrets.json","expect":true},{"pattern":"secrets.json","path":"my-secrets.json","expect":false},{"pattern":"secrets.yml","path":"config/secrets.yml","expect":true},{"pattern":"secrets.yml","path":"secrets.yaml","expect":false},{"pattern":"secrets.yaml","path":"config/secrets.yaml","expect":true},{"pattern":"secrets.yaml","path":"secrets.yml","expect":false},{"pattern":"secrets.toml","path":"config/secrets.toml","expect":true},{"pattern":"secrets.toml","path":"secrets.toml.example","expect":false},{"pattern":"secrets.ini","path":"config/secrets.ini","expect":true},{"pattern":"secrets.ini","path":"app.ini","expect":false},{"pattern":"secrets.txt","path":"notes/secrets.txt","expect":true},{"pattern":"secrets.txt","path":"secrets.txt.bak","expect":false},{"pattern":".ssh","path":".ssh/id_rsa","expect":true},{"pattern":".ssh","path":"home/user/.ssh/config","expect":true},{"pattern":".ssh","path":".ssh_config","expect":false},{"pattern":".aws","path":".aws/credentials","expect":true},{"pattern":".aws","path":"home/user/.aws/config","expect":true},{"pattern":".aws","path":".aws-sam/build.toml","expect":false},{"pattern":".gnupg","path":".gnupg/secring.gpg","expect":true},{"pattern":".gnupg","path":".gnupg2/pubring.kbx","expect":false},{"pattern":".docker","path":".docker/config.json","expect":true},{"pattern":".docker","path":"docker/Dockerfile","expect":false},{"pattern":".kube","path":".kube/config","expect":true},{"pattern":".kube","path":"kube/deployment.yaml","expect":false},{"pattern":".terraform","path":".terraform/terraform.tfstate","expect":true},{"pattern":".terraform","path":"terraform/main.tf","expect":false},{"pattern":".npmrc","path":".npmrc","expect":true},{"pattern":".npmrc","path":"packages/web/.npmrc","expect":true},{"pattern":".npmrc","path":"npmrc","expect":false},{"pattern":".yarnrc","path":".yarnrc","expect":true},{"pattern":".yarnrc","path":".yarnrc.yml","expect":false},{"pattern":".yarnrc.yml","path":".yarnrc.yml","expect":true},{"pattern":".yarnrc.yml","path":".yarnrc","expect":false},{"pattern":".netrc","path":".netrc","expect":true},{"pattern":".netrc","path":"_netrc","expect":false},{"pattern":"_netrc","path":"_netrc","expect":true},{"pattern":"_netrc","path":".netrc","expect":false},{"pattern":".pypirc","path":"home/.pypirc","expect":true},{"pattern":".pypirc","path":"pypirc","expect":false},{"pattern":".pgpass","path":"home/.pgpass","expect":true},{"pattern":".pgpass","path":"pgpass.conf","expect":false},{"pattern":".my.cnf","path":"home/.my.cnf","expect":true},{"pattern":".my.cnf","path":"my.cnf","expect":false},{"pattern":".htpasswd","path":"etc/nginx/.htpasswd","expect":true},{"pattern":".htpasswd","path":"htpasswd","expect":false},{"pattern":".vault-token","path":"home/.vault-token","expect":true},{"pattern":".vault-token","path":"vault-token","expect":false},{"pattern":"id_rsa*","path":"id_rsa","expect":true},{"pattern":"id_rsa*","path":"keys/id_rsa.pub","expect":true},{"pattern":"id_rsa*","path":"my_id_rsa","expect":false},{"pattern":"id_dsa*","path":"legacy/id_dsa","expect":true},{"pattern":"id_dsa*","path":"my_id_dsa","expect":false},{"pattern":"id_ecdsa*","path":"keys/id_ecdsa-cert.pub","expect":true},{"pattern":"id_ecdsa*","path":"my_id_ecdsa","expect":false},{"pattern":"id_ed25519*","path":"keys/id_ed25519.pub","expect":true},{"pattern":"id_ed25519*","path":"my_id_ed25519","expect":false},{"pattern":"*.pem","path":"tls/fullchain.pem","expect":true},{"pattern":"*.pem","path":"tls/fullchain.pem.bak","expect":false},{"pattern":"*.key","path":"certs/server.key","expect":true},{"pattern":"*.key","path":"certs/server.key.pub","expect":false},{"pattern":"*.p8","path":"apple/AuthKey_123.p8","expect":true},{"pattern":"*.p8","path":"apple/AuthKey_123.p8.txt","expect":false},{"pattern":"*.p12","path":"certs/client.p12","expect":true},{"pattern":"*.p12","path":"certs/client.p12.enc","expect":false},{"pattern":"*.pfx","path":"win/signing.pfx","expect":true},{"pattern":"*.pfx","path":"win/signing.pfx.bak","expect":false},{"pattern":"*.ppk","path":"putty/server.ppk","expect":true},{"pattern":"*.ppk","path":"putty/server.ppk.old","expect":false},{"pattern":"*.jks","path":"java/keystore.jks","expect":true},{"pattern":"*.jks","path":"java/keystore.jks.bak","expect":false},{"pattern":"*.keystore","path":"android/release.keystore","expect":true},{"pattern":"*.keystore","path":"android/keystore.properties","expect":false},{"pattern":"*.kdbx","path":"vault/passwords.kdbx","expect":true},{"pattern":"*.kdbx","path":"vault/passwords.kdbx.html","expect":false},{"pattern":"*credentials*.json","path":"gcp/client_credentials_prod.json","expect":true},{"pattern":"*credentials*.json","path":"credentials.json","expect":true},{"pattern":"*credentials*.json","path":"gcp/credentials.yaml","expect":false},{"pattern":"service-account*.json","path":"gcp/service-account-prod.json","expect":true},{"pattern":"service-account*.json","path":"gcp/my-service-account.json","expect":false},{"pattern":"*.tfstate","path":"infra/terraform.tfstate","expect":true},{"pattern":"*.tfstate","path":"infra/terraform.tfstate.backup","expect":false},{"pattern":"*.tfstate.*","path":"infra/terraform.tfstate.backup","expect":true},{"pattern":"*.tfstate.*","path":"infra/terraform.tfstate","expect":false},{"pattern":"*.tfvars","path":"infra/prod.tfvars","expect":true},{"pattern":"*.tfvars","path":"infra/prod.tfvars.json","expect":false},{"pattern":"*.tfvars.json","path":"infra/prod.tfvars.json","expect":true},{"pattern":"*.tfvars.json","path":"infra/prod.tfvars","expect":false},{"pattern":".*_history","path":"home/.bash_history","expect":true},{"pattern":".*_history","path":"home/.zsh_history","expect":true},{"pattern":".*_history","path":"home/bash_history","expect":false},{"pattern":"fish_history","path":"local/share/fish/fish_history","expect":true},{"pattern":"fish_history","path":"docs/fish_history.md","expect":false},{"pattern":".env*","path":".ENV","expect":true},{"pattern":".env*","path":"docs/.Env.Local","expect":true},{"pattern":"*.pem","path":"TLS/Server.PEM","expect":true},{"pattern":"id_ed25519*","path":"keys/ID_ED25519.PUB","expect":true},{"pattern":".AWS","path":"docs/.aws/credentials","expect":true},{"pattern":"*.KEY","path":"certs/tls.key","expect":true},{"pattern":"secrets","path":"docs/ſecrets/note.md","expect":true},{"pattern":".ssh","path":".ſsh/config","expect":true},{"pattern":"id_rsa*","path":"keys/ıd_rsa","expect":true},{"pattern":".env*","path":"docs/.env","expect":true},{"pattern":".ssh","path":".ssh/config","expect":true},{"pattern":"*.key","path":"tls/server.Key","expect":true},{"pattern":".ENV*","path":"apps/.env.local","expect":true},{"pattern":".env*","path":"docs\.env","expect":true},{"pattern":".env*","path":"docs/.env","expect":true},{"pattern":".env*","path":"%2eenv","expect":true},{"pattern":".env*","path":"%2E%45%4E%56","expect":true},{"pattern":".ssh","path":"docs/%2essh/config","expect":true},{"pattern":".env*","path":"%252eenv","expect":true},{"pattern":".aws","path":"docs/%252Eaws/credentials","expect":true},{"pattern":"*.pem","path":"certs/root%252Epem","expect":true},{"pattern":".env*","path":"%25252eenv","expect":true},{"pattern":".gnupg","path":"home/%25252Egnupg/key","expect":true},{"pattern":"id_rsa*","path":"keys/%252569d_rsa","expect":true},{"pattern":".env*","path":"docs%2f.env","expect":true},{"pattern":".ssh","path":"docs%252f.ssh%252fconfig","expect":true},{"pattern":".aws","path":"docs%25255c.aws%25255ccredentials","expect":true},{"pattern":".env*","path":"docs/%EF%BC%8Eenv","expect":true},{"pattern":".env*","path":"docs/%25EF%25BC%258Eenv","expect":true},{"pattern":".env*","path":".env.%ZZlocal","expect":true},{"pattern":".env*","path":"%2eenv.%ZZ","expect":true},{"pattern":".env*","path":"%2eenv.trail%","expect":true},{"pattern":".env*","path":"%2eenv.short%2","expect":true},{"pattern":"secrets","path":"secrets%2F%ZZ","expect":true},{"pattern":".env*","path":"%FF/.env","expect":true},{"pattern":".env*","path":"%ZZenv","expect":false},{"pattern":".env*","path":"%2Genv","expect":false},{"pattern":"*credentials*.json","path":"my-credentials\\\\backup.json","expect":true},{"pattern":"*credentials*.json","path":"my-credentials%5Cbackup.json","expect":true},{"pattern":".env*","path":"apps\\\\backend\\\\.env","expect":true},{"pattern":".ssh","path":"C:\\\\Users\\\\example\\\\.ssh\\\\id","expect":true},{"pattern":"*.key","path":"certs\\\\prod/tls.key","expect":true},{"pattern":".env*","path":"///docs///.env///","expect":true},{"pattern":".env*","path":"\\\\\\\\\\\\docs\\\\\\\\\\\\.env\\\\\\\\","expect":true},{"pattern":".env*","path":"","expect":false},{"pattern":".env*","path":"/","expect":false},{"pattern":".env*","path":"\\\\","expect":false},{"pattern":".env.?","path":".env.?","expect":true},{"pattern":".env.?","path":".env.a","expect":false},{"pattern":"file+[1](test)$^|{2}.txt","path":"dir/file+[1](test)$^|{2}.txt","expect":true},{"pattern":"file+[1](test)$^|{2}.txt","path":"dir/file+1(test)$^|{2}.txt","expect":false},{"pattern":"a|b.md","path":"docs/a|b.md","expect":true},{"pattern":"a|b.md","path":"docs/a.md","expect":false},{"pattern":"foo+bar.md","path":"docs/foo+bar.md","expect":true},{"pattern":"foo+bar.md","path":"docs/fooooobar.md","expect":false},{"pattern":"unrelated","path":"docs/safe-%252561-name/readme.md","expect":false},{"pattern":".env","path":"%2525252Eenv","expect":true},{"pattern":".env*","path":"%2525252Eenv","expect":true},{"pattern":".aws","path":"docs/%2525252Eaws/credentials","expect":true},{"pattern":"unrelated","path":"%2525252Eenv","expect":true},{"pattern":"unrelated","path":"docs/%2525252Eaws/credentials","expect":true},{"pattern":"unrelated","path":"docs/safe-%25252561-name/readme.md","expect":true},{"pattern":".env*","path":"%252525252Eenv","expect":true},{"pattern":"unrelated","path":"a/b/%2525252F/c.md","expect":true},{"pattern":"unrelated","path":"a/b/%2525255C..%2525255C/c.md","expect":true},{"pattern":"unrelated","path":"docs/%2525252Eenv%ZZ","expect":true}]'), r = Object.freeze(a.map(({ pattern: e, path: t, expect: p }) => Object.freeze({ pattern: e, path: t, expect: p }))), n = () => r;
1
+ const a = /* @__PURE__ */ JSON.parse('[{"pattern":".env*","path":".env","expect":true},{"pattern":".env*","path":"apps/web/.env.production","expect":true},{"pattern":".env*","path":".envrc","expect":true},{"pattern":".env*","path":".env~","expect":true},{"pattern":".env*","path":".env-old","expect":true},{"pattern":".env*","path":".env_backup","expect":true},{"pattern":".env*","path":"docs/environment.md","expect":false},{"pattern":".env*","path":"docs/prod.env","expect":false},{"pattern":"*.env","path":"prod.env","expect":true},{"pattern":"*.env","path":"config/staging.env","expect":true},{"pattern":"*.env","path":"prod.env.bak","expect":false},{"pattern":"*.env","path":"environment.md","expect":false},{"pattern":"*.env.*","path":"prod.env.bak","expect":true},{"pattern":"*.env.*","path":"config/deploy.env.production","expect":true},{"pattern":"*.env.*","path":"prod.env","expect":false},{"pattern":"*.env.*","path":"prod.environment.md","expect":false},{"pattern":"*.env~*","path":"prod.env~","expect":true},{"pattern":"*.env~*","path":"config/prod.env~1","expect":true},{"pattern":"*.env~*","path":"prod.env","expect":false},{"pattern":"*.env-*","path":"prod.env-old","expect":true},{"pattern":"*.env-*","path":"config/app.env-2026","expect":true},{"pattern":"*.env-*","path":"my-env-file.md","expect":false},{"pattern":"*.env_*","path":"prod.env_backup","expect":true},{"pattern":"*.env_*","path":"config/app.env_local","expect":true},{"pattern":"*.env_*","path":"my_env_file.md","expect":false},{"pattern":"*.env#*","path":"#prod.env#","expect":true},{"pattern":"*.env#*","path":"config/prod.env#1","expect":true},{"pattern":"*.env#*","path":"prod.env","expect":false},{"pattern":".git","path":".git/config","expect":true},{"pattern":".git","path":"sub/.git/HEAD","expect":true},{"pattern":".git","path":".github/workflows/ci.yml","expect":false},{"pattern":".git","path":".gitignore","expect":false},{"pattern":".git-credentials","path":".git-credentials","expect":true},{"pattern":".git-credentials","path":"home/.git-credentials","expect":true},{"pattern":".git-credentials","path":"git-credentials","expect":false},{"pattern":".svn","path":".svn/entries","expect":true},{"pattern":".svn","path":"svn/entries","expect":false},{"pattern":".hg","path":".hg/hgrc","expect":true},{"pattern":".hg","path":".hgignore","expect":false},{"pattern":"node_modules","path":"node_modules/pkg/index.js","expect":true},{"pattern":"node_modules","path":"packages/a/node_modules/b/README.md","expect":true},{"pattern":"node_modules","path":"docs/node_modules_guide.md","expect":false},{"pattern":"secrets","path":"secrets/api.md","expect":true},{"pattern":"secrets","path":"config/secrets/prod.json","expect":true},{"pattern":"secrets","path":"docs/secrets-overview.md","expect":false},{"pattern":".secrets","path":".secrets/key","expect":true},{"pattern":".secrets","path":"app/.secrets","expect":true},{"pattern":".secrets","path":".secrets.md","expect":false},{"pattern":"secrets.json","path":"secrets.json","expect":true},{"pattern":"secrets.json","path":"config/secrets.json","expect":true},{"pattern":"secrets.json","path":"my-secrets.json","expect":false},{"pattern":"secrets.yml","path":"config/secrets.yml","expect":true},{"pattern":"secrets.yml","path":"secrets.yaml","expect":false},{"pattern":"secrets.yaml","path":"config/secrets.yaml","expect":true},{"pattern":"secrets.yaml","path":"secrets.yml","expect":false},{"pattern":"secrets.toml","path":"config/secrets.toml","expect":true},{"pattern":"secrets.toml","path":"secrets.toml.example","expect":false},{"pattern":"secrets.ini","path":"config/secrets.ini","expect":true},{"pattern":"secrets.ini","path":"app.ini","expect":false},{"pattern":"secrets.txt","path":"notes/secrets.txt","expect":true},{"pattern":"secrets.txt","path":"secrets.txt.bak","expect":false},{"pattern":".ssh","path":".ssh/id_rsa","expect":true},{"pattern":".ssh","path":"home/user/.ssh/config","expect":true},{"pattern":".ssh","path":".ssh_config","expect":false},{"pattern":".aws","path":".aws/credentials","expect":true},{"pattern":".aws","path":"home/user/.aws/config","expect":true},{"pattern":".aws","path":".aws-sam/build.toml","expect":false},{"pattern":".gnupg","path":".gnupg/secring.gpg","expect":true},{"pattern":".gnupg","path":".gnupg2/pubring.kbx","expect":false},{"pattern":".docker","path":".docker/config.json","expect":true},{"pattern":".docker","path":"docker/Dockerfile","expect":false},{"pattern":".kube","path":".kube/config","expect":true},{"pattern":".kube","path":"kube/deployment.yaml","expect":false},{"pattern":".terraform","path":".terraform/terraform.tfstate","expect":true},{"pattern":".terraform","path":"terraform/main.tf","expect":false},{"pattern":".npmrc","path":".npmrc","expect":true},{"pattern":".npmrc","path":"packages/web/.npmrc","expect":true},{"pattern":".npmrc","path":"npmrc","expect":false},{"pattern":".yarnrc","path":".yarnrc","expect":true},{"pattern":".yarnrc","path":".yarnrc.yml","expect":false},{"pattern":".yarnrc.yml","path":".yarnrc.yml","expect":true},{"pattern":".yarnrc.yml","path":".yarnrc","expect":false},{"pattern":".netrc","path":".netrc","expect":true},{"pattern":".netrc","path":"_netrc","expect":false},{"pattern":"_netrc","path":"_netrc","expect":true},{"pattern":"_netrc","path":".netrc","expect":false},{"pattern":".pypirc","path":"home/.pypirc","expect":true},{"pattern":".pypirc","path":"pypirc","expect":false},{"pattern":".pgpass","path":"home/.pgpass","expect":true},{"pattern":".pgpass","path":"pgpass.conf","expect":false},{"pattern":".my.cnf","path":"home/.my.cnf","expect":true},{"pattern":".my.cnf","path":"my.cnf","expect":false},{"pattern":".htpasswd","path":"etc/nginx/.htpasswd","expect":true},{"pattern":".htpasswd","path":"htpasswd","expect":false},{"pattern":".vault-token","path":"home/.vault-token","expect":true},{"pattern":".vault-token","path":"vault-token","expect":false},{"pattern":"id_rsa*","path":"id_rsa","expect":true},{"pattern":"id_rsa*","path":"keys/id_rsa.pub","expect":true},{"pattern":"id_rsa*","path":"my_id_rsa","expect":false},{"pattern":"id_dsa*","path":"legacy/id_dsa","expect":true},{"pattern":"id_dsa*","path":"my_id_dsa","expect":false},{"pattern":"id_ecdsa*","path":"keys/id_ecdsa-cert.pub","expect":true},{"pattern":"id_ecdsa*","path":"my_id_ecdsa","expect":false},{"pattern":"id_ed25519*","path":"keys/id_ed25519.pub","expect":true},{"pattern":"id_ed25519*","path":"my_id_ed25519","expect":false},{"pattern":"*.pem","path":"tls/fullchain.pem","expect":true},{"pattern":"*.pem","path":"tls/fullchain.pem.bak","expect":false},{"pattern":"*.key","path":"certs/server.key","expect":true},{"pattern":"*.key","path":"certs/server.key.pub","expect":false},{"pattern":"*.p8","path":"apple/AuthKey_123.p8","expect":true},{"pattern":"*.p8","path":"apple/AuthKey_123.p8.txt","expect":false},{"pattern":"*.p12","path":"certs/client.p12","expect":true},{"pattern":"*.p12","path":"certs/client.p12.enc","expect":false},{"pattern":"*.pfx","path":"win/signing.pfx","expect":true},{"pattern":"*.pfx","path":"win/signing.pfx.bak","expect":false},{"pattern":"*.ppk","path":"putty/server.ppk","expect":true},{"pattern":"*.ppk","path":"putty/server.ppk.old","expect":false},{"pattern":"*.jks","path":"java/keystore.jks","expect":true},{"pattern":"*.jks","path":"java/keystore.jks.bak","expect":false},{"pattern":"*.keystore","path":"android/release.keystore","expect":true},{"pattern":"*.keystore","path":"android/keystore.properties","expect":false},{"pattern":"*.kdbx","path":"vault/passwords.kdbx","expect":true},{"pattern":"*.kdbx","path":"vault/passwords.kdbx.html","expect":false},{"pattern":"*credentials*.json","path":"gcp/client_credentials_prod.json","expect":true},{"pattern":"*credentials*.json","path":"credentials.json","expect":true},{"pattern":"*credentials*.json","path":"gcp/credentials.yaml","expect":false},{"pattern":"service-account*.json","path":"gcp/service-account-prod.json","expect":true},{"pattern":"service-account*.json","path":"gcp/my-service-account.json","expect":false},{"pattern":"*.tfstate","path":"infra/terraform.tfstate","expect":true},{"pattern":"*.tfstate","path":"infra/terraform.tfstate.backup","expect":false},{"pattern":"*.tfstate.*","path":"infra/terraform.tfstate.backup","expect":true},{"pattern":"*.tfstate.*","path":"infra/terraform.tfstate","expect":false},{"pattern":"*.tfvars","path":"infra/prod.tfvars","expect":true},{"pattern":"*.tfvars","path":"infra/prod.tfvars.json","expect":false},{"pattern":"*.tfvars.json","path":"infra/prod.tfvars.json","expect":true},{"pattern":"*.tfvars.json","path":"infra/prod.tfvars","expect":false},{"pattern":".*_history","path":"home/.bash_history","expect":true},{"pattern":".*_history","path":"home/.zsh_history","expect":true},{"pattern":".*_history","path":"home/bash_history","expect":false},{"pattern":"fish_history","path":"local/share/fish/fish_history","expect":true},{"pattern":"fish_history","path":"docs/fish_history.md","expect":false},{"pattern":".env*","path":".ENV","expect":true},{"pattern":".env*","path":"docs/.Env.Local","expect":true},{"pattern":"*.pem","path":"TLS/Server.PEM","expect":true},{"pattern":"id_ed25519*","path":"keys/ID_ED25519.PUB","expect":true},{"pattern":".AWS","path":"docs/.aws/credentials","expect":true},{"pattern":"*.KEY","path":"certs/tls.key","expect":true},{"pattern":"secrets","path":"docs/ſecrets/note.md","expect":true},{"pattern":".ssh","path":".ſsh/config","expect":true},{"pattern":"id_rsa*","path":"keys/ıd_rsa","expect":true},{"pattern":".env*","path":"docs/.env","expect":true},{"pattern":".ssh","path":".ssh/config","expect":true},{"pattern":"*.key","path":"tls/server.Key","expect":true},{"pattern":".ENV*","path":"apps/.env.local","expect":true},{"pattern":".env*","path":"docs\.env","expect":true},{"pattern":".env*","path":"docs/.env","expect":true},{"pattern":".env*","path":"%2eenv","expect":true},{"pattern":".env*","path":"%2E%45%4E%56","expect":true},{"pattern":".ssh","path":"docs/%2essh/config","expect":true},{"pattern":".env*","path":"%252eenv","expect":true},{"pattern":".aws","path":"docs/%252Eaws/credentials","expect":true},{"pattern":"*.pem","path":"certs/root%252Epem","expect":true},{"pattern":".env*","path":"%25252eenv","expect":true},{"pattern":".gnupg","path":"home/%25252Egnupg/key","expect":true},{"pattern":"id_rsa*","path":"keys/%252569d_rsa","expect":true},{"pattern":".env*","path":"docs%2f.env","expect":true},{"pattern":".ssh","path":"docs%252f.ssh%252fconfig","expect":true},{"pattern":".aws","path":"docs%25255c.aws%25255ccredentials","expect":true},{"pattern":".env*","path":"docs/%EF%BC%8Eenv","expect":true},{"pattern":".env*","path":"docs/%25EF%25BC%258Eenv","expect":true},{"pattern":".env*","path":".env.%ZZlocal","expect":true},{"pattern":".env*","path":"%2eenv.%ZZ","expect":true},{"pattern":".env*","path":"%2eenv.trail%","expect":true},{"pattern":".env*","path":"%2eenv.short%2","expect":true},{"pattern":"secrets","path":"secrets%2F%ZZ","expect":true},{"pattern":".env*","path":"%FF/.env","expect":true},{"pattern":".env*","path":"%ZZenv","expect":false},{"pattern":".env*","path":"%2Genv","expect":false},{"pattern":"*credentials*.json","path":"my-credentials\\\\backup.json","expect":true},{"pattern":"*credentials*.json","path":"my-credentials%5Cbackup.json","expect":true},{"pattern":".env*","path":"apps\\\\backend\\\\.env","expect":true},{"pattern":".ssh","path":"C:\\\\Users\\\\example\\\\.ssh\\\\id","expect":true},{"pattern":"*.key","path":"certs\\\\prod/tls.key","expect":true},{"pattern":".env*","path":"///docs///.env///","expect":true},{"pattern":".env*","path":"\\\\\\\\\\\\docs\\\\\\\\\\\\.env\\\\\\\\","expect":true},{"pattern":".env*","path":"","expect":false},{"pattern":".env*","path":"/","expect":false},{"pattern":".env*","path":"\\\\","expect":false},{"pattern":".env.?","path":".env.?","expect":true},{"pattern":".env.?","path":".env.a","expect":false},{"pattern":"file+[1](test)$^|{2}.txt","path":"dir/file+[1](test)$^|{2}.txt","expect":true},{"pattern":"file+[1](test)$^|{2}.txt","path":"dir/file+1(test)$^|{2}.txt","expect":false},{"pattern":"a|b.md","path":"docs/a|b.md","expect":true},{"pattern":"a|b.md","path":"docs/a.md","expect":false},{"pattern":"foo+bar.md","path":"docs/foo+bar.md","expect":true},{"pattern":"foo+bar.md","path":"docs/fooooobar.md","expect":false},{"pattern":"unrelated","path":"docs/safe-%252561-name/readme.md","expect":false},{"pattern":".env","path":"%2525252Eenv","expect":true},{"pattern":".env*","path":"%2525252Eenv","expect":true},{"pattern":".aws","path":"docs/%2525252Eaws/credentials","expect":true},{"pattern":"unrelated","path":"%2525252Eenv","expect":true},{"pattern":"unrelated","path":"docs/%2525252Eaws/credentials","expect":true},{"pattern":"unrelated","path":"docs/safe-%25252561-name/readme.md","expect":true},{"pattern":".env*","path":"%252525252Eenv","expect":true},{"pattern":"unrelated","path":"a/b/%2525252F/c.md","expect":true},{"pattern":"unrelated","path":"a/b/%2525255C..%2525255C/c.md","expect":true},{"pattern":"unrelated","path":"docs/%2525252Eenv%ZZ","expect":true}]'), r = [
2
+ {
3
+ written: "7K3M9QX2AB4W",
4
+ canonical: "7K3M9QX2AB4W"
5
+ },
6
+ {
7
+ written: "1A0B1C0D1E0J",
8
+ canonical: "1A0B1C0D1E0J"
9
+ },
10
+ {
11
+ written: "000000000000",
12
+ canonical: "000000000000"
13
+ },
14
+ {
15
+ written: "0000000000ZZ",
16
+ canonical: "0000000000ZZ"
17
+ },
18
+ {
19
+ written: "7K3M-9QX2-AB4W",
20
+ canonical: "7K3M9QX2AB4W"
21
+ },
22
+ {
23
+ written: "7k3m-9qx2-ab4w",
24
+ canonical: "7K3M9QX2AB4W"
25
+ },
26
+ {
27
+ written: "-7K3M--9QX2-AB4W-",
28
+ canonical: "7K3M9QX2AB4W"
29
+ },
30
+ {
31
+ written: "lAoB-iCoD-lEoj",
32
+ canonical: "1A0B1C0D1E0J"
33
+ },
34
+ {
35
+ written: "7K3M9RX2AB4W",
36
+ canonical: null
37
+ },
38
+ {
39
+ written: "7KM39QX2AB4W",
40
+ canonical: null
41
+ },
42
+ {
43
+ written: "ZZZZZZZZZZZ$",
44
+ canonical: null
45
+ },
46
+ {
47
+ written: "00000000014U",
48
+ canonical: null
49
+ },
50
+ {
51
+ written: "7K3M9QX2AB4",
52
+ canonical: null
53
+ },
54
+ {
55
+ written: "7K3M9QX2AB4WX",
56
+ canonical: null
57
+ },
58
+ {
59
+ written: "",
60
+ canonical: null
61
+ },
62
+ {
63
+ written: "----",
64
+ canonical: null
65
+ },
66
+ {
67
+ written: "7K3M 9QX2 AB4W",
68
+ canonical: null
69
+ },
70
+ {
71
+ written: "7K3M9QX2AB4W",
72
+ canonical: null
73
+ },
74
+ {
75
+ written: "ıA0B1C0D1E0J",
76
+ canonical: null
77
+ }
78
+ ], n = Object.freeze(a.map(({ pattern: e, path: t, expect: p }) => Object.freeze({ pattern: e, path: t, expect: p }))), c = Object.freeze(r.map(({ written: e, canonical: t }) => Object.freeze({ written: e, canonical: t }))), s = () => n, h = () => c;
2
79
  export {
3
- n as denyVectors
80
+ s as denyVectors,
81
+ h as documentIdVectors
4
82
  };
@@ -1 +1 @@
1
- "use strict";const e=require("react"),m=require("./location-D8DyDkuA.cjs"),f=u=>({minimumExceededSummary:u.panelGroupMinimumExceededSummary,minimumExceededDetail:u.panelGroupMinimumExceededDetail,maximumInsufficientSummary:u.panelGroupMaximumInsufficientSummary,maximumInsufficientDetail:u.panelGroupMaximumInsufficientDetail}),d=u=>{const a=e.useRef(u);e.useLayoutEffect(()=>{a.current=u},[u]);const c=e.useRef(null),r=e.useRef(null),n=e.useRef(!1),t=e.useCallback(()=>{r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,c.current!==null&&a.current(c.current)},m.SPLIT_PERSIST_DELAY_MS)},[]);e.useEffect(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);const s=e.useCallback((i,o)=>{c.current=i,o.source==="keyboard"?t():o.source==="pointer"&&(n.current=!0)},[t]),l=e.useCallback(i=>{if(i){n.current=!1;return}n.current&&(n.current=!1,t())},[t]);return e.useMemo(()=>({layoutChanged:s,draggingChanged:l}),[s,l])};exports.toPanelGroupLabels=f;exports.useSplitPersistence=d;
1
+ "use strict";const e=require("react"),m=require("./location-DrOP6t1F.cjs"),f=u=>({minimumExceededSummary:u.panelGroupMinimumExceededSummary,minimumExceededDetail:u.panelGroupMinimumExceededDetail,maximumInsufficientSummary:u.panelGroupMaximumInsufficientSummary,maximumInsufficientDetail:u.panelGroupMaximumInsufficientDetail}),d=u=>{const a=e.useRef(u);e.useLayoutEffect(()=>{a.current=u},[u]);const c=e.useRef(null),r=e.useRef(null),n=e.useRef(!1),t=e.useCallback(()=>{r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,c.current!==null&&a.current(c.current)},m.SPLIT_PERSIST_DELAY_MS)},[]);e.useEffect(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);const s=e.useCallback((i,o)=>{c.current=i,o.source==="keyboard"?t():o.source==="pointer"&&(n.current=!0)},[t]),l=e.useCallback(i=>{if(i){n.current=!1;return}n.current&&(n.current=!1,t())},[t]);return e.useMemo(()=>({layoutChanged:s,draggingChanged:l}),[s,l])};exports.toPanelGroupLabels=f;exports.useSplitPersistence=d;
@@ -1,5 +1,5 @@
1
1
  import { useRef as t, useLayoutEffect as f, useCallback as m, useEffect as d, useMemo as p } from "react";
2
- import { S } from "./location--KvTA0Ri.js";
2
+ import { S } from "./location-Dh6K-y7w.js";
3
3
  const E = (e) => ({
4
4
  minimumExceededSummary: e.panelGroupMinimumExceededSummary,
5
5
  minimumExceededDetail: e.panelGroupMinimumExceededDetail,
@@ -37,6 +37,7 @@ Tests and host styling may rely on the `data-testid` values and `data-aqmx-*` at
37
37
  | `data-testid="markdown-explorer-unsaved-guard"` / `-cancel` / `-confirm` | The confirmation before a navigation drops unsaved drafts (a modal `dialog`, one per explorer) | As above; `-confirm` drops those drafts and goes on |
38
38
  | `data-testid="markdown-explorer-history"` | The revisions dialog (a modal `dialog`, named `historyTitle`) | Holds `-history-loading`, `-history-failure` or `-history-empty`, else `-history-list` of `-history-entry` buttons (`aria-pressed` for the one shown), the picked revision's text `-history-text` (focusable, so the keyboard scrolls it) or `-history-revision-failure`, and `-history-close` and `-history-restore` (`aria-disabled` until a revision's text is shown) |
39
39
  | `data-testid="markdown-explorer-document-refresh"` | The Refresh document button, in the bar | Reads that document alone again past the host's caches. The page views name it by its visible label (`refreshDocumentLabel`; tooltip `refreshDocument`); a panel's is icon-only, with `aria-label` and `title` set to `refreshDocumentNamed` (the panel title). Carries `aria-busy="true"` and `data-aqmx-busy="true"` while it runs, and `aria-disabled="true"` then and while the document loads (never `disabled`) |
40
+ | `data-testid="markdown-explorer-document-permalink"` | The Copy permalink button, in the bar after Refresh document | Drawn with `documentIds` in the configuration while the document is not edited, from the server's render on (see [URL contract](url-contract.md#document-ids)); `aria-disabled="true"` while the document loads or failed, when it ignores presses. The page views name it by its visible label (`copyPermalinkLabel`; tooltip `copyPermalink`); a panel's is icon-only, with `aria-label` and `title` set to `copyPermalinkNamed`. Carries `data-aqmx-copy-outcome`: `idle`, then `copied` or `failed` for 2 seconds after a press, while its `title` says what happened (its name never changes; the announcer speaks the outcome). |
40
41
  | `data-testid="markdown-explorer-document-maximize"` | The Maximize button that ends the tree view's document bar | Icon-only, with `aria-label` and `title` naming what a press does (`documentMaximize`, or `documentRestore` while the document is maximized) and no `aria-pressed`; the same element in every state. Absent in the single view and in a multi-view panel |
41
42
  | `data-aqmx-maximized` | The tree view's document column (the bar and the document region, `data-aqmx-content-pane`) | `true` while the column covers the page — the document is maximized and has something to show, or its folder's README is being looked for — else `false` (a multi-view panel's frame carries the same attribute, see [Multi-panel view](#multi-panel-view)) |
42
43
  | `data-testid="markdown-explorer-document-refresh-failure"` | Notice of a document refresh that failed, inside the bar below its button row | No live role (the announcer speaks the same text); carries `data-aqmx-failure` (the reason). The failure is the document's answer, or the reading of the part the document's content reads itself (a table file's table, a document shown as written) when that content showed a copy of it, which stays. Shown while the copy of the document it kept stays on screen: a newer answer that replaces or confirms that copy, a move to another document (it does not come back on return), a switch between the document rendered and as written and that control's next refresh take it down. It is the one notice of a failed refresh: no notice inside the document repeats it |
@@ -81,9 +82,10 @@ The tree's stand-in Tab stop, present while the tab-stop row is outside the tree
81
82
  | `data-testid="markdown-explorer-document-empty"` | No document selected | |
82
83
  | `data-testid="markdown-explorer-folder-empty"` | The tree view's folder without a README | The region carries `data-aqmx-document-kind="empty"`; a page view announces the text (`folderReadmeMissing`) once for each folder shown |
83
84
  | `data-testid="markdown-explorer-folder-failure"` | Failure to list the tree view's folder, or to load the tree it lies in | Carries `data-aqmx-failure` (the reason; `not-found` for no such folder); its callout has no role: the announcer speaks the failure (`documentFailed`, with the folder's name), once for each failed attempt. A `failed` listing offers Try again (`retry`) |
84
- | `data-testid="markdown-explorer-document-skeleton"` | Placeholder while a pane has no document to show yet (its first document, one the server gave up on, or the README of the tree view's folder while it is looked for) | The region carries `aria-busy="true"` |
85
+ | `data-testid="markdown-explorer-document-skeleton"` | Placeholder while a pane has no document to show yet (its first document, one the server gave up on, the README of the tree view's folder while it is looked for, or the document of an ID URL while its ID is resolved) | The region carries `aria-busy="true"` |
85
86
  | `data-testid="markdown-explorer-document-progress"` | Progress bar while the next document (or a fresh copy of a failed one) loads over the one still shown | The region carries `aria-busy="true"` meanwhile, also during router navigations |
86
87
  | `data-testid="markdown-explorer-document-failure"` | Document failure | Carries `data-aqmx-failure` (the reason); its callout has no role in every view (tree, single and multi-view panels): the announcer speaks the failure (`documentFailed`), once for each failed attempt |
88
+ | `data-testid="markdown-explorer-document-id-failure"` | Failure to open the document of an ID URL, in the document's place | Carries `data-aqmx-failure` (the reason); its callout has no role: the announcer speaks the failure. Holds Try again only for `failed`, which resolves the ID again (see [URL contract](url-contract.md#document-ids)). |
87
89
  | `data-testid="markdown-explorer-document-notices"` | The notices above a document region | `role="status"` (polite, not atomic), in the page whenever the pane shows a document and empty while there is nothing to tell, so each notice is spoken as it appears; in this order: the document changed elsewhere, media that could not be loaded, media that cannot be played |
88
90
  | `data-testid="markdown-explorer-document-notice"` | One notice above the document | Carries `data-aqmx-notice` (`changed` under the host change policy `"notify"`, `media-load` or `media-unplayable`) and `data-aqmx-tone` (`info` for `changed`, `warning` for the media); `changed` and `media-load` hold a Reload button (`reload`), and a media notice names the one medium it tells of or counts two or more |
89
91
  | `data-testid="markdown-explorer-text-truncated"` | Notice under a cut text preview, or a cut source of a Markdown document shown as written | |
@@ -116,9 +116,9 @@ In a tree or children listing, an entry with an empty name, or with a path the b
116
116
  - The page loader's responses carry `Cache-Control: private, no-store` through the exported `headers`, to both the HTML document and the single-fetch data.
117
117
  - The data route answers a React Router single-fetch request (`<dataPath>/<operation>.data`: its own URL path ends in `.data`, which React Router strips from the route's `url` argument and `params` but not from `request.url`) with a `not-found` failure (404) before authenticating or calling a source. React Router would run the route for it, read the whole response into memory and keep none of the headers above but `Set-Cookie`.
118
118
  - Status codes: 200 for a tree, children, ancestors, reveal, document, text, refresh or editor (`edit`, `save`, `preview`, `revisions`, `revision`) answer (a refresh answers the reloaded tree, as a tree request does, failures included), 400 for a missing or malformed parameter or draft,
119
- 401 when the reader is signed out, 403 when the reader may not use the explorer (or a refresh, a document request marked as one's, a save or a preview lacks its proof), 404 for an unknown operation or source for a children request to a source without `children()`, for an ancestors request to a source without `ancestors()` and for the editor's operations without `edit` ports, 405 (with `Allow`) for a wrong method, 413 for a draft longer than `editMaxBytes`.
119
+ 401 when the reader is signed out, 403 when the reader may not use the explorer (or a refresh, a document request marked as one's, a save, a preview or an ID's issue lacks its proof), 404 for an unknown operation or source for a children request to a source without `children()`, for an ancestors request to a source without `ancestors()`, for the editor's operations without `edit` ports and for the ID operations without `documentIds` ports, 405 (with `Allow`) for a wrong method, 413 for a draft longer than `editMaxBytes`.
120
120
  When `authenticate`, `principalKey` or the route itself throws, the answer is the failure the exception maps to, with that failure's status: an `ExplorerError` keeps its reason (`too-large` is 413; `not-configured`, `unsupported` and `failed` are 500; the other reasons take the statuses above), and any other exception is logged and answered `failed` with 500.
121
- A document or folder that cannot be shown — missing, denied, too large — is answered with status 200 and a failure in the JSON, so one inaccessible document does not break the multi-panel view.
121
+ A document or folder that cannot be shown — missing, denied, too large — is answered with status 200 and a failure in the JSON, so one inaccessible document does not break the multi-panel view. The ID operations (`issue-id`, `resolve-id`) answer a failure with its own status instead (see [Document IDs](#document-ids)).
122
122
  - The tree refresh (`POST {dataPath}/refresh`) requires the custom request header `X-Markdown-Explorer: refresh` and passes the shared cross-origin check of server routes (`crossOriginRefusal` of `@aiquants/request-isolation`, serving no navigation from another origin).
123
123
  That check refuses a request whose `Sec-Fetch-Site` is present and neither `same-origin` nor `none`, and a request without Fetch Metadata whose `Origin` is present and does not name the request's host (another host or port, `null`, or a value that is not a URL), so neither a cross-site form nor a page of a sibling subdomain can trigger it.
124
124
  It reloads the tree from the source (the source receives `refresh: true`) and answers a tree whose walk began after the refresh arrived; refreshes arriving while a walk runs share one trailing walk, so repeated refreshes never run more than one walk of a tree at a time.
@@ -168,6 +168,26 @@ In a tree or children listing, an entry with an empty name, or with a path the b
168
168
  Its answer for an internal link — `204 No Content` with `X-Link-Card-Skip: private-network` — is passed through unchanged, and `@aiquants/markdown`'s link card shows the link as a compact card and writes one `console.info` line; the explorer logs nothing of its own for cards.
169
169
  - **Same origin.** The browser asks the page's own origin with its credentials and `redirect: "error"`, so no `connect-src` beyond `'self'` is needed and no cross-origin page can read an answer (the data route grants no CORS).
170
170
 
171
+ ## Document IDs
172
+
173
+ - **An ID is not a permission.** The ID operations and ID URLs exist only with `documentIds` in the configuration and the server's `documentIds` ports (the host's registry, which binds each ID to one document path). Without the ports both operations answer as unknown operations (404) before the method is checked or the reader authenticated, and without the option the ID URLs' slug is an unknown view slug.
174
+ Opening an ID URL, or asking `resolve-id`, passes the same checks as the document's path URL — the reader's authentication, the deny rules, the sources' boundaries (with the admitting source's `confirm`) and the document's existence, confirmed through the host's `asset` port without opening its bytes — and an answer names the path only to a reader who can open it:
175
+
176
+ | Case | Answer | The path |
177
+ | --- | --- | --- |
178
+ | The ID is written wrong | 400 `invalid` | Not sent (the registry is not asked) |
179
+ | The registry does not know the ID (never issued, or forgotten when its document was erased) | 404 `not-found` | Not sent |
180
+ | The deny rules refuse the path, no source's boundary admits it, or the reader may not read it | 403 `forbidden` | Not sent |
181
+ | No document is at the path | 404 `not-found` | Not sent |
182
+ | The reader can open the document | A `302` to its path URL (the page loader), 200 `{ status: "ok", path, source }` (`resolve-id`) | Sent: the reader can open that path |
183
+
184
+ - A 403 tells that the ID exists. An ID carries about 55 random bits and cannot be guessed, so the 403 tells only a reader who was given the ID, for whom "it exists, but you may not read it" is a lead to ask for access.
185
+ - **`resolve-id`** (`GET` or `HEAD` `{dataPath}/resolve-id?id=`; 405 with `Allow: GET, HEAD` otherwise) takes an ID in its canonical form only (the lenient reading of lowercase, hyphens, `I`, `L` and `O` is the page URL's alone): a missing, repeated or other value is 400 before the registry is asked. The page loader answers an ID URL by the same resolution (see [URL contract](url-contract.md#document-ids)), and both send `Cache-Control: private, no-store`, so a redirect never outlives the binding it followed.
186
+ - **`issue-id`** (`POST {dataPath}/issue-id?path=`; 405 with `Allow: POST` otherwise) needs `X-Markdown-Explorer: document-id` and the shared cross-origin check of a refresh (`crossOriginRefusal`), checked before the reader is authenticated (403), so another site's page cannot make a reader issue IDs.
187
+ It issues only for a document the reader can open now: a missing, repeated or unacceptable `path`, or one ending in a slash (it has no URL), is 400; a path the deny rules refuse is 403 and logged with the operation, since the bar names only documents it shows; a path outside every source's boundary is 403 and a path where no document is 404 — all before the registry is called.
188
+ The explorer draws each candidate itself and hands the registry the path it shows, never a source's `readPath`; a `taken` candidate draws another, up to 4 candidates, and a fourth `taken` is logged and answered `failed` (500).
189
+ - **Answers are checked.** An `existing` ID that is not in its canonical form, a `bound` path that is not acceptable or has no URL, and any other shape break the contract: logged (a resolution's log names the operation and the error, not the path) and answered `failed` (500). An `ExplorerError` the registry throws answers its reason's status without a log, and any other exception is logged and answered `failed`.
190
+
171
191
  ## Caches and identity
172
192
 
173
193
  - The server's tree cache is keyed by the reader's scope (derived from the principal's stable key) and the source. `cacheScope: "shared"` lets readers share one entry when the tree does not depend on who reads it; `createFileSystemSource` uses `"principal"` unless told otherwise, which a source wrapped to filter its tree per reader must keep. Entries expire after `treeCache.ttlMs`, and the cache holds at most `treeCache.maxEntries` trees and `treeCache.maxBytes` of their JSON.
@@ -188,6 +208,7 @@ In a tree or children listing, an entry with an empty name, or with a path the b
188
208
  Answer the page's data requests with `createInProcessDataFetch` passed as `<MarkdownExplorer fetch>` (the page's router has no `basename`). The browser loads a document's images and media from their URLs, never through that fetch, so serve `{dataPath}/asset` (and `mediaDataPath`) over the page's own scheme, or show content without them.
189
209
  - Implement the ports: `document` and `asset` (and `children` for lazy folders) read what the explorer admitted, with the `readPath` it hands them, and report the same `version` for the same file.
190
210
  The explorer serves every file's bytes itself (see [What the explorer serves](#what-the-explorer-serves)), so the host writes no asset route (nor a route for a document's source, which the `text` operation reads through the same port); the `asset` port only finds the file and opens its bytes, through a handle it checked (for example by comparing the opened file's device, inode, size and modification time with those of the checked path, refusing a file that has changed since it was found) and aborting with the request's signal.
211
+ - With `documentIds`, give the server a registry (`documentIds` ports) whose bindings are unique both ways — one ID per path, one path per ID — and whose `issue` is atomic, so two readers pressing Copy permalink at once get one ID; bind the path the explorer passes (the document path, never a source's `readPath`), keep the ID in the canonical form it was given, and forget a document's ID when the document is erased, so an ID never comes to name another document. The ID grants nothing: keep authorizing every read by its path.
191
212
  - Refuse React Router single-fetch requests in any code your data route module runs before it hands the request to `dataLoader` or `dataAction` (which refuse them themselves), and in every resource route of your own: answer 404 for a request whose own URL path (`new URL(request.url).pathname`) ends in `.data`, before authenticating or touching storage.
192
213
  React Router strips that suffix from `params` and from the loader's `url` argument, runs the loader for such a request, reads the whole `Response` body into memory and drops every header but `Set-Cookie`.
193
214
  - When a source addresses documents by ID rather than by name (a cloud drive, for example), the deny rules can only filter its listings by entry name; its `document` function must refuse denied names itself, since the request carries only the ID.
@@ -9,8 +9,10 @@ This page is part of the host-facing contract of `@aiquants/markdown-explorer`;
9
9
  | Tree | `{basePath}/{views.tree}`, `{basePath}/{views.tree}/{document}` or `{basePath}/{views.tree}/{folder}/` | `source`, `style`, `align`, `maximized`, `markup` |
10
10
  | Multi-panel | `{basePath}/{views.multi}` | `source`, `doc` (repeated, in panel order), `maximized`, `markup` (repeated, in the order of `doc`) |
11
11
  | Single | `{basePath}/{views.single}/{document}` | `source`, `style`, `align`, `markup`, `showToc`, `showStyle`, `showAlign`, `padding`, `width`, `maxWidth` |
12
+ | Document ID (with `documentIds`) | `{basePath}/{documentIds.slug}/{ID}` (opens the document in the tree view) or `{basePath}/{documentIds.slug}/{ID}/{views.single}` (in the single view) | `style`, `align`; with `{views.single}` also `showToc`, `showStyle`, `showAlign`, `padding`, `width`, `maxWidth` |
12
13
 
13
14
  - `basePath` and the view slugs come from `defineExplorerConfig` (`tree`, `multi` and `single` by default). The data route lives at `dataPath` and is not a page.
15
+ With `documentIds: { slug }` in the configuration, the URLs under that slug name a document by its ID instead of its path and are never a location of their own: they send the reader to the path URL of the document the ID names (see [Document IDs](#document-ids)). Without the option, the slug is an unknown view slug like any other.
14
16
  - `source` names the source shown in the tree: one of the server's sources, whose ids come from `createMarkdownExplorer`'s `sources` in their order (the browser reads them from the page data's `sources`). The first is the default and is written by **omission**; it is never written explicitly. A source id is lowercase letters, digits and `-`, starting with a letter or digit (`isExplorerSourceId`).
15
17
  - The tree view shows a document, a folder (its README, see [Folder segment](#folder-segment)) or neither: `ExplorerLocation`'s tree view has `doc` and `folder`, at most one of them not `null`.
16
18
  - `markup` names the Markdown documents, SVG images and table files shown as written (their source — an SVG image's own SVG, a table file's CSV or TSV —, the document bar's Source toggle) instead of rendered (a table file as its table): in the tree and single views `markup=true` for the URL's document — in the tree view a folder's README too —, and in the multi-panel view one `markup` per open document shown that way, in the order of `doc` (a maximized document included).
@@ -57,6 +59,10 @@ Every URL resolves either to a location or to a redirect to its canonical form.
57
59
  | Multi-panel `maximized` repeated, or not one of the open documents | Redirect without `maximized` |
58
60
  | Multi-panel `markup` values that are not open documents, repeated, or out of the order of `doc` | Redirect with each open document shown as written once, in the order of `doc` |
59
61
  | A path segment after the multi-panel slug | Redirect to the multi-panel view without it |
62
+ | An ID URL without an ID (`{basePath}/{documentIds.slug}` or `{basePath}/{documentIds.slug}/`) | Redirect to the tree view without a document, keeping a valid `source` |
63
+ | Anything after a well-written ID but `{views.single}` alone (a view slug, a trailing slash, more segments) | Redirect to the ID URL without it, keeping `style` and `align` (the embedding parameters are dropped) |
64
+ | An ID written in lowercase, with hyphens, or with `I`, `L` or `O` | Read as its canonical ID and not redirected (its resolution sends the reader to the path URL once) |
65
+ | An ID written wrong (not 12 symbols once the hyphens are dropped, a character outside the alphabet, a wrong check symbol) | Not redirected: the page shows the `invalid` failure (status 400 from the loader) |
60
66
  | `style` naming no configured document style, `align` other than `left`, `center` or `right` | Ignored (the reader's own setting applies) |
61
67
  | `padding` outside 0–256 or not written in decimal digits (signs, exponents, hexadecimal, surrounding spaces and `Infinity` are not numbers here), `width` / `maxWidth` not a CSS length in `px`, `rem`, `em`, `ch`, `vw` or `%` | Ignored (the default applies) |
62
68
  | `showToc`, `showStyle`, `showAlign` other than `false` | Ignored (the control is shown) |
@@ -69,6 +75,26 @@ The page loader answers a non-canonical URL with a redirect, and the browser app
69
75
  A redirect keeps the URL's fragment on a page load and on the explorer's own replacing navigation: the browser carries the fragment across the loader's HTTP redirect of a document request (whose `Location` has none), and the replacing navigation appends the current one to the canonical URL, so loading `/docs#%E6%A6%82%E8%A6%81` ends on the tree view's URL with `#%E6%A6%82%E8%A6%81`.
70
76
  A client-side navigation from another route to a non-canonical URL loses its fragment: the loader runs and redirects, and React Router builds the redirected location from the redirect's `Location` alone. To keep a fragment, link to the canonical URL (`explorerHref`) with the fragment appended.
71
77
 
78
+ ## Document IDs
79
+
80
+ With `documentIds: { slug }` in the configuration, a document can also be linked by an ID that stays with it when its path changes: the host's registry (the server's `documentIds` ports, see the README's [Document IDs](../../README.md#document-ids)) binds each ID to one document path, and an ID URL sends the reader to the path URL of the document its ID names. The ID is not a permission: an ID URL opens a document exactly when its path URL would, for the same reader (see [Security](security.md#document-ids)).
81
+
82
+ - **The ID.** 12 symbols of Crockford's Base32 (`DOCUMENT_ID_ALPHABET`: the digits and the capital letters without `I`, `L`, `O` and `U`; `DOCUMENT_ID_LENGTH`): 11 random symbols and a check symbol, the remainder of the 11 read as a base-32 number divided by 37.
83
+ The server draws each from Web Crypto and draws again when the remainder is 32 or more, so every check symbol is in the same alphabet and an ID carries about 55 random bits, never guessed.
84
+ `isCanonicalDocumentId(value)` tells whether a value is an ID in its canonical form; `parseDocumentId(written)` reads one as a reader writes it — hyphens dropped, lowercase raised, `I` and `L` read as `1` and `O` as `0` — into its canonical form, or `null` when it is no ID (a character outside ASCII is refused before any case is raised); `groupDocumentId(id)` groups an ID in its canonical form by four symbols for reading aloud and copying by hand (`7K3M-9QX2-AB4W`; any other value throws a `RangeError`). A URL carries the canonical form, ungrouped.
85
+ `documentIdVectors()` of `@aiquants/markdown-explorer/testing` lists the answers `parseDocumentId` owes, for a host's registry and for an implementation of the rule in another language.
86
+ - **Writing and reading.** `explorerHref(config, { view: "document-id", id, opens?, overrides?, embed? })` writes an ID URL: `opens: "single"` writes `{views.single}` after the ID and is the only form that takes `embed`; `overrides` (`style`, `align`) are written as in a path URL. It throws a `TypeError` with a configuration without `documentIds`, and a `RangeError` for an ID that is not canonical, an `opens` other than `"single"`, embedding options without `opens: "single"`, or a value the resolver would ignore.
87
+ `resolveExplorerLocation` answers an ID URL with `{ kind: "document-id", id, opens, location }`: the canonical ID (`null` when the URL's ID is written wrong), how its document opens (`ExplorerDocumentIdOpening`: the tree view with the overrides, or the single view with the overrides and the embedding options), and the location drawn meanwhile and on a failure — the default source's tree without a document. The URL's `source`, `doc`, `markup` and `maximized` are not read: the ID decides the document.
88
+ - **The page loader.** It authenticates first (a signed-out reader gets `signedOutPage` before the registry is asked), resolves the ID as the `resolve-id` operation does, and answers a document the reader can open with a `302` to its path URL — the view the ID URL asked for, under the source that admits the document (written by omission when it is the default), with the ID URL's overrides and embedding parameters — carrying `Cache-Control: private, no-store` and the authentication's headers.
89
+ Never `301` or `308`: a browser keeps a permanent redirect, and the path an ID names changes when its document moves.
90
+ Otherwise it answers the page with the location above, `documentId: { id, failure }` in the page data (never naming the path) and the failure's status: `invalid` 400 for an ID written wrong (the registry is not asked), `not-found` 404 for an ID the registry does not know or a path where no document is, `forbidden` 403 for a path the deny rules refuse, no source's boundary admits or the reader may not read, `failed` 500. Every other page carries `documentId: null`.
91
+ The browser keeps a fragment across the `302` on a page load; a client-side navigation from another route loses it, as for any redirect above.
92
+ - **In the browser.** A navigation inside the explorer to an ID URL (a document's link, Back and Forward) runs no loader: the explorer shows the document's skeleton in the location above, asks the data route's `resolve-id` operation, and moves with a replacing navigation to the path URL it writes with `explorerHref`, keeping the current fragment, so Back returns to the page the reader came from. A change of URL cancels the resolution in flight.
93
+ A failure is drawn in the document's place (`data-testid="markdown-explorer-document-id-failure"`, its reason in `data-aqmx-failure`) under its own title, with words of its own for `invalid`, `not-found` and `forbidden`, and with Try again for `failed` only; a failure the loader already answered for the same ID is drawn without asking again, and an answer that names a source the page does not know is drawn as `failed`.
94
+ - **Copy permalink.** The bar of a document that is not edited holds Copy permalink, from the server's render on; while the document loads or failed, the button is unavailable (`aria-disabled`) and ignores presses, so the bar's buttons keep their places whatever the document's state.
95
+ A press asks the data route's `issue-id` operation for the document's ID (issued on the first press, the same ID ever after) and copies its ID URL as an absolute URL with the router's basename, in the form of the current view: the single view's with its overrides and embedding parameters, the tree view's with its overrides, and a multi-view panel's as the tree view's without any.
96
+ The clipboard write starts inside the press, since Safari allows a write only during the reader's gesture: a `ClipboardItem` whose text the ID URL fulfils once the server answers. The outcome is announced and shown as the bar's other copies are, with the ID grouped, or with why nothing was copied: the failure's title when no ID could be issued, otherwise the browser's refusal — a browser without the asynchronous clipboard or without `ClipboardItem` included, never retried with `writeText()`, which would write outside the reader's gesture.
97
+
72
98
  ## Document links
73
99
 
74
100
  A Markdown link that should open another document inside the explorer is resolved by the host's parser, which marks it on the `a` element:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/markdown-explorer",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Markdown document explorer for React Router 8 (framework mode): a source tree with a single-document view and a multi-panel reading view, storage-agnostic server ports, golden-ratio layout and an en / ja UI.",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -115,7 +115,7 @@
115
115
  "devDependencies": {
116
116
  "@aiquants/directory-tree": "6.1.3",
117
117
  "@aiquants/drag-drop-panels": "0.14.1",
118
- "@aiquants/markdown": "13.0.0",
118
+ "@aiquants/markdown": "13.1.0",
119
119
  "@aiquants/resize-panels": "2.3.0",
120
120
  "@aiquants/spreadsheet": "0.20.0",
121
121
  "@aiquants/virtualscroll": "3.24.0",
@@ -1,103 +0,0 @@
1
- import { jsx as x, jsxs as G } from "react/jsx-runtime";
2
- import { useCallback as m, useMemo as w, useEffect as E, useSyncExternalStore as j, useState as q, useRef as H, useLayoutEffect as U } from "react";
3
- import { useLocation as $ } from "react-router";
4
- import { e as p, c as B } from "./location--KvTA0Ri.js";
5
- import { u as g, f as D, r as Y, F as J, g as K, h as Q, i as V, D as W, P as X, j as Z } from "./index-C1YMH-yI.js";
6
- import { isMaximizeEscape as I } from "@aiquants/drag-drop-panels";
7
- import { l as ee } from "./ownUrls-Dh5g6ZJi.js";
8
- import { E as te, a as ne, b as re } from "./ExplorerSplit-CfP1smbT.js";
9
- const se = (t) => {
10
- const { config: e, labels: n, announcer: r } = g(), s = D(), u = m(() => {
11
- const a = t.doc !== null ? t.doc : t.folder;
12
- if (a === null) throw new RangeError("[markdown-explorer] a tree view without a document or a folder has nothing to maximize");
13
- s(p(e, { ...t, maximized: !t.maximized }), "browse");
14
- const o = ee(a);
15
- r.announce(t.maximized ? n.documentRestored(o) : n.documentMaximized(o));
16
- }, [e, s, t, r, n]);
17
- return w(() => ({ maximized: t.maximized, toggle: u }), [t.maximized, u]);
18
- }, oe = (t, e) => {
19
- E(() => {
20
- if (!t) return;
21
- const n = (r) => {
22
- I(r) && (r.preventDefault(), e());
23
- };
24
- return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
25
- }, [t, e]);
26
- }, ae = (t, e) => t.claim !== e.claim || t.readme.status !== e.readme.status ? !1 : t.readme.status === "failed" && e.readme.status === "failed" ? t.readme.failure === e.readme.failure : t.readme.status === "ok" && e.readme.status === "ok" ? t.readme.readme === e.readme.readme : !0, ie = (t, e, n) => {
27
- let r = null;
28
- return () => {
29
- const s = t.version(), u = t.read(e), a = u.status !== "pending";
30
- if (r !== null && r.version === s && r.tree === u && r.settled === a) return r.state;
31
- const o = Y(t, e, n), i = r !== null && ae(r.state, o) ? r.state : o;
32
- return r = { version: s, tree: u, settled: a, state: i }, i;
33
- };
34
- }, ue = (t, e, n) => {
35
- let r = !0, s = null;
36
- const u = () => {
37
- r && n();
38
- }, a = () => {
39
- const i = t.read(e);
40
- i === s || i.status !== "pending" || (s = i, i.then(u, u));
41
- };
42
- a();
43
- const o = t.subscribe(() => {
44
- a(), n();
45
- });
46
- return () => {
47
- r = !1, o();
48
- };
49
- }, ce = () => J, le = (t, e) => {
50
- const { trees: n } = g(), r = w(() => e === null ? null : ie(n, t, e), [n, t, e]), s = m((d) => r === null ? () => {
51
- } : ue(n, t, d), [r, n, t]), u = m(() => r === null ? null : r(), [r]), a = m(() => r === null ? null : ce(), [r]), o = j(s, u, a), i = o?.claim === !0;
52
- return E(() => e === null ? void 0 : n.open(t), [n, t, e]), E(() => e === null || !i ? void 0 : n.claimChildren(t, /* @__PURE__ */ new Map([[e, "direct"]])), [n, t, e, i]), o === null ? null : o.readme;
53
- }, me = /* @__PURE__ */ new Set(), de = Object.freeze({ kind: "loading" }), pe = (t, e) => e.status === "loading" ? de : e.status === "failed" ? { kind: "failure", folder: t, failure: e.failure, onRetry: e.retry } : { kind: "no-readme", folder: t }, ke = ({ location: t }) => {
54
- const { config: e } = g(), n = D(), { hash: r } = $(), { source: s, doc: u, folder: a, overrides: o, markup: i, maximized: d } = t, [S, R] = q(te), M = w(() => ({ gathered: S, onGatheredChange: R }), [S]), f = le(s, a), l = f === null ? u : f.status === "ok" ? f.readme : null, k = w(() => a === null || f === null ? K : pe(a, f), [a, f]), h = d && (l !== null || k.kind === "loading"), N = m((c) => n(p(e, { view: "tree", source: s, doc: c, overrides: o }), "browse"), [n, e, s, o]), P = m((c) => n(p(e, { view: "tree", source: s, folder: c, overrides: o }), "browse"), [n, e, s, o]), F = m(
55
- (c) => {
56
- const v = c.kind === "folder" ? { folder: c.path } : c.kind === "document" ? { doc: c.path } : {};
57
- n(p(e, { view: "tree", source: s, ...v, overrides: o }), "close-folder");
58
- },
59
- [n, e, s, o]
60
- ), T = m((c) => n(p(e, { view: "tree", source: c, doc: u, folder: a, overrides: o, markup: i, maximized: d }), "switch-source"), [n, e, u, a, o, i, d]), C = m((c) => n(`${p(e, { view: "tree", source: c, doc: u, folder: a, overrides: o, markup: i, maximized: d })}${r}`, "browse"), [n, e, u, a, o, i, d, r]), L = m(
61
- (c) => {
62
- const v = B(e, c);
63
- n(p(e, { view: "multi", source: s, docs: v, markup: i && l !== null && v.includes(l) ? [l] : [] }), "switch-view");
64
- },
65
- [n, e, s, l, i]
66
- ), _ = w(() => ({ href: p(e, l === null ? { view: "multi", source: s } : { view: "multi", source: s, docs: [l], markup: i ? [l] : [] }), target: "multi" }), [e, s, l, i]), b = H(d);
67
- U(() => {
68
- b.current = d;
69
- }, [d]);
70
- const z = m(() => b.current, []), y = w(() => ({ kind: "page", view: "tree", overrides: o, embed: {}, maximized: z }), [o, z]), A = Q(t), O = se(t);
71
- return oe(h, O.toggle), /* @__PURE__ */ x(
72
- ne,
73
- {
74
- view: "tree",
75
- contentCoversPage: h,
76
- explorer: /* @__PURE__ */ x(
77
- re,
78
- {
79
- mode: "tree",
80
- sourceId: s,
81
- currentPath: a === null ? u : a,
82
- openPaths: me,
83
- onOpenDocument: N,
84
- onOpenFolder: P,
85
- onCloseFolder: F,
86
- currentFolder: a !== null,
87
- onSourceChange: T,
88
- onRevealSource: C,
89
- viewSwitch: _,
90
- tray: M,
91
- onOpenSelection: L
92
- }
93
- ),
94
- content: /* @__PURE__ */ G("div", { className: "aqmx-document-column aqmx-tree-document", "data-aqmx-maximized": h ? "true" : "false", ...V, children: [
95
- l === null ? null : /* @__PURE__ */ x(W, { path: l, placement: X, markup: A, maximize: O }),
96
- /* @__PURE__ */ x(Z, { path: l, absence: k, markup: i, variant: y })
97
- ] })
98
- }
99
- );
100
- };
101
- export {
102
- ke as TreeLayout
103
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),a=require("react"),L=require("react-router"),x=require("./location-D8DyDkuA.cjs"),d=require("./index-LQWQfpAf.cjs"),H=require("@aiquants/drag-drop-panels"),_=require("./ownUrls-B259RGgd.cjs"),b=require("./ExplorerSplit-D_0VohOv.cjs"),j=t=>{const{config:e,labels:n,announcer:r}=d.useExplorer(),s=d.useExplorerNavigate(),c=a.useCallback(()=>{const u=t.doc!==null?t.doc:t.folder;if(u===null)throw new RangeError("[markdown-explorer] a tree view without a document or a folder has nothing to maximize");s(x.explorerHref(e,{...t,maximized:!t.maximized}),"browse");const o=_.lastPathSegment(u);r.announce(t.maximized?n.documentRestored(o):n.documentMaximized(o))},[e,s,t,r,n]);return a.useMemo(()=>({maximized:t.maximized,toggle:c}),[t.maximized,c])},A=(t,e)=>{a.useEffect(()=>{if(!t)return;const n=r=>{H.isMaximizeEscape(r)&&(r.preventDefault(),e())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,e])},G=(t,e)=>t.claim!==e.claim||t.readme.status!==e.readme.status?!1:t.readme.status==="failed"&&e.readme.status==="failed"?t.readme.failure===e.readme.failure:t.readme.status==="ok"&&e.readme.status==="ok"?t.readme.readme===e.readme.readme:!0,U=(t,e,n)=>{let r=null;return()=>{const s=t.version(),c=t.read(e),u=c.status!=="pending";if(r!==null&&r.version===s&&r.tree===c&&r.settled===u)return r.state;const o=d.readFolderReadme(t,e,n),l=r!==null&&G(r.state,o)?r.state:o;return r={version:s,tree:c,settled:u,state:l},l}},B=(t,e,n)=>{let r=!0,s=null;const c=()=>{r&&n()},u=()=>{const l=t.read(e);l===s||l.status!=="pending"||(s=l,l.then(c,c))};u();const o=t.subscribe(()=>{u(),n()});return()=>{r=!1,o()}},Y=()=>d.FOLDER_README_LOADING,J=(t,e)=>{const{trees:n}=d.useExplorer(),r=a.useMemo(()=>e===null?null:U(n,t,e),[n,t,e]),s=a.useCallback(p=>r===null?()=>{}:B(n,t,p),[r,n,t]),c=a.useCallback(()=>r===null?null:r(),[r]),u=a.useCallback(()=>r===null?null:Y(),[r]),o=a.useSyncExternalStore(s,c,u),l=o?.claim===!0;return a.useEffect(()=>e===null?void 0:n.open(t),[n,t,e]),a.useEffect(()=>e===null||!l?void 0:n.claimChildren(t,new Map([[e,"direct"]])),[n,t,e,l]),o===null?null:o.readme},K=new Set,Q=Object.freeze({kind:"loading"}),V=(t,e)=>e.status==="loading"?Q:e.status==="failed"?{kind:"failure",folder:t,failure:e.failure,onRetry:e.retry}:{kind:"no-readme",folder:t},W=({location:t})=>{const{config:e}=d.useExplorer(),n=d.useExplorerNavigate(),{hash:r}=L.useLocation(),{source:s,doc:c,folder:u,overrides:o,markup:l,maximized:p}=t,[g,z]=a.useState(b.EMPTY_SELECTION),M=a.useMemo(()=>({gathered:g,onGatheredChange:z}),[g]),f=J(s,u),m=f===null?c:f.status==="ok"?f.readme:null,k=a.useMemo(()=>u===null||f===null?d.NO_DOCUMENT:V(u,f),[u,f]),E=p&&(m!==null||k.kind==="loading"),O=a.useCallback(i=>n(x.explorerHref(e,{view:"tree",source:s,doc:i,overrides:o}),"browse"),[n,e,s,o]),R=a.useCallback(i=>n(x.explorerHref(e,{view:"tree",source:s,folder:i,overrides:o}),"browse"),[n,e,s,o]),D=a.useCallback(i=>{const v=i.kind==="folder"?{folder:i.path}:i.kind==="document"?{doc:i.path}:{};n(x.explorerHref(e,{view:"tree",source:s,...v,overrides:o}),"close-folder")},[n,e,s,o]),N=a.useCallback(i=>n(x.explorerHref(e,{view:"tree",source:i,doc:c,folder:u,overrides:o,markup:l,maximized:p}),"switch-source"),[n,e,c,u,o,l,p]),P=a.useCallback(i=>n(`${x.explorerHref(e,{view:"tree",source:i,doc:c,folder:u,overrides:o,markup:l,maximized:p})}${r}`,"browse"),[n,e,c,u,o,l,p,r]),T=a.useCallback(i=>{const v=x.canonicalMultiDocuments(e,i);n(x.explorerHref(e,{view:"multi",source:s,docs:v,markup:l&&m!==null&&v.includes(m)?[m]:[]}),"switch-view")},[n,e,s,m,l]),q=a.useMemo(()=>({href:x.explorerHref(e,m===null?{view:"multi",source:s}:{view:"multi",source:s,docs:[m],markup:l?[m]:[]}),target:"multi"}),[e,s,m,l]),h=a.useRef(p);a.useLayoutEffect(()=>{h.current=p},[p]);const S=a.useCallback(()=>h.current,[]),y=a.useMemo(()=>({kind:"page",view:"tree",overrides:o,embed:{},maximized:S}),[o,S]),F=d.usePageMarkupToggle(t),C=j(t);return A(E,C.toggle),w.jsx(b.ExplorerSplit,{view:"tree",contentCoversPage:E,explorer:w.jsx(b.ExplorerPane,{mode:"tree",sourceId:s,currentPath:u===null?c:u,openPaths:K,onOpenDocument:O,onOpenFolder:R,onCloseFolder:D,currentFolder:u!==null,onSourceChange:N,onRevealSource:P,viewSwitch:q,tray:M,onOpenSelection:T}),content:w.jsxs("div",{className:"aqmx-document-column aqmx-tree-document","data-aqmx-maximized":E?"true":"false",...d.CONTENT_PANE,children:[m===null?null:w.jsx(d.DocumentRefreshBar,{path:m,placement:d.PAGE_DOCUMENT_REFRESH,markup:F,maximize:C}),w.jsx(d.DocumentPane,{path:m,absence:k,markup:l,variant:y})]})})};exports.TreeLayout=W;