archsight 0.5.3 → 0.5.5
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.
- checksums.yaml +4 -4
- data/docs/configuration.md +1 -1
- data/docs/diagram.md +101 -4
- data/docs/import.md +27 -2
- data/docs/modeling.md +1 -1
- data/docs/pages.md +1 -1
- data/lib/archsight/diagram/graph/attributes.rb +59 -6
- data/lib/archsight/diagram/graph/builder.rb +101 -3
- data/lib/archsight/diagram/graph/edge.rb +7 -1
- data/lib/archsight/diagram/graph/node.rb +29 -1
- data/lib/archsight/diagram/graph/port.rb +25 -0
- data/lib/archsight/diagram/graph.rb +18 -1
- data/lib/archsight/diagram/includes.rb +22 -4
- data/lib/archsight/diagram/layout/alignment.rb +138 -0
- data/lib/archsight/diagram/layout/expander.rb +13 -0
- data/lib/archsight/diagram/layout/ports.rb +182 -0
- data/lib/archsight/diagram/layout/rank_arranger.rb +27 -1
- data/lib/archsight/diagram/layout/stacker.rb +3 -2
- data/lib/archsight/diagram/layout.rb +15 -5
- data/lib/archsight/diagram/legend/inventory.rb +52 -4
- data/lib/archsight/diagram/legend/row.rb +44 -0
- data/lib/archsight/diagram/parser/ast.rb +9 -0
- data/lib/archsight/diagram/parser.rb +56 -5
- data/lib/archsight/diagram/renderer/edge_renderer.rb +1 -1
- data/lib/archsight/diagram/renderer/node_renderer.rb +35 -1
- data/lib/archsight/diagram/renderer/path_renderer.rb +2 -2
- data/lib/archsight/diagram/renderer/stylesheet.rb +10 -1
- data/lib/archsight/diagram/renderer/text_renderer.rb +1 -0
- data/lib/archsight/diagram/renderer.rb +21 -5
- data/lib/archsight/diagram/routing/edge_routing.rb +106 -5
- data/lib/archsight/diagram/support/markdown_text.rb +2 -2
- data/lib/archsight/diagram/support/text_metrics.rb +7 -3
- data/lib/archsight/git_source.rb +5 -3
- data/lib/archsight/helpers.rb +3 -1
- data/lib/archsight/import/handlers/gitea.rb +195 -0
- data/lib/archsight/import/handlers/github.rb +1 -0
- data/lib/archsight/import/handlers/gitlab.rb +1 -0
- data/lib/archsight/import/handlers/repository.rb +7 -4
- data/lib/archsight/reading_time.rb +66 -0
- data/lib/archsight/resources/implementation_work_package.rb +2 -0
- data/lib/archsight/version.rb +1 -1
- data/lib/archsight/web/api/openapi/spec.yaml +20 -1
- data/lib/archsight/web/api/page_helpers.rb +5 -1
- data/lib/archsight/web/public/vue/{DocPage-B2AVspsD.js → DocPage-BHffBQ3u.js} +1 -1
- data/lib/archsight/web/public/vue/{EditorPage-BYSZG_O0.js → EditorPage-BHZtvtnN.js} +1 -1
- data/lib/archsight/web/public/vue/{ErrorPage-eL_Woec4.js → ErrorPage-BQARAwF8.js} +1 -1
- data/lib/archsight/web/public/vue/{GraphView-YEiPBxPd.js → GraphView-D84CH00D.js} +1 -1
- data/lib/archsight/web/public/vue/{HomePage-BeLTwv2y.js → HomePage-BJpTPWFz.js} +2 -2
- data/lib/archsight/web/public/vue/{InstanceRouter-DgvdUouW.js → InstanceRouter-C1Da3nWo.js} +1 -1
- data/lib/archsight/web/public/vue/{KindList-BkYvYpnh.js → KindList-DNRUVuEJ.js} +1 -1
- data/lib/archsight/web/public/vue/PageView-DzKj212I.js +1 -0
- data/lib/archsight/web/public/vue/{QueryError-DzGMgvyb.js → QueryError-CTVAL1Tm.js} +1 -1
- data/lib/archsight/web/public/vue/{ResourceList-Cr9ExUDn.js → ResourceList-CRt_FpfS.js} +1 -1
- data/lib/archsight/web/public/vue/{SearchResults-D6tx3Atc.js → SearchResults-BMwBz4BB.js} +1 -1
- data/lib/archsight/web/public/vue/{WikiPage-BhaaveRq.js → WikiPage-DSEL2gmd.js} +1 -1
- data/lib/archsight/web/public/vue/{index-le1guGp1.js → index-JZkWwfYg.js} +2 -2
- data/lib/archsight/web/public/vue.html +1 -1
- metadata +19 -14
- data/lib/archsight/web/public/vue/PageView-B3SnDw9S.js +0 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "fileutils"
|
|
4
|
+
require "net/http"
|
|
5
|
+
require "json"
|
|
6
|
+
require "uri"
|
|
7
|
+
require "openssl"
|
|
8
|
+
require_relative "../handler"
|
|
9
|
+
require_relative "../registry"
|
|
10
|
+
require_relative "cache_pruner"
|
|
11
|
+
|
|
12
|
+
# Gitea handler - lists repositories of a Gitea (or Forgejo) server and generates child Import resources
|
|
13
|
+
#
|
|
14
|
+
# Configuration:
|
|
15
|
+
# import/config/host - Gitea host, e.g. "gitea.example.com" (required)
|
|
16
|
+
# import/config/org - Organization (or user) to list; without it every repository the token can see is listed
|
|
17
|
+
# import/config/scheme - "https" (default) or "http"
|
|
18
|
+
# import/config/verifySSL - "false" to skip certificate verification (default: true)
|
|
19
|
+
# import/config/rateLimitMs - Pause between API requests in milliseconds (default: 0)
|
|
20
|
+
# import/config/repoOutputPath - Output path for repository handler results (e.g., "generated/repositories.yaml")
|
|
21
|
+
# import/config/childCacheTime - Cache time for generated child imports (e.g., "1h", "30m")
|
|
22
|
+
# import/config/fallbackTeam - Default team when no contributor match found (propagated to child imports)
|
|
23
|
+
# import/config/botTeam - Team for bot-only repositories (propagated to child imports)
|
|
24
|
+
# import/config/corporateAffixes - Comma-separated corporate username affixes for team matching (propagated to child imports)
|
|
25
|
+
# import/config/defaultVisibility - Default visibility for non-public repos (default: "internal")
|
|
26
|
+
# import/config/cacheRoot - Override for the local git cache root (default: ~/.cache/archsight/git)
|
|
27
|
+
#
|
|
28
|
+
# Environment:
|
|
29
|
+
# GITEA_TOKEN - Gitea access token (required)
|
|
30
|
+
# Create at: <host>/user/settings/applications (scope read:repository, plus read:organization for `org`)
|
|
31
|
+
#
|
|
32
|
+
# Output:
|
|
33
|
+
# Generates Import:Repo:* resources for each repository
|
|
34
|
+
# The repository handler will clone/sync the actual git repositories (over SSH, so the SSH keys must work)
|
|
35
|
+
#
|
|
36
|
+
# Before generating imports, prunes any cache subdirectory under
|
|
37
|
+
# cacheRoot/gitea/<host>/<owner> that no longer corresponds to a repo returned by
|
|
38
|
+
# the API (e.g. a repo that was renamed or deleted), so stale clones don't
|
|
39
|
+
# linger and get picked up by later importers.
|
|
40
|
+
class Archsight::Import::Handlers::Gitea < Archsight::Import::Handler
|
|
41
|
+
# generates child imports (see Handler.generates_imports?)
|
|
42
|
+
def self.generates_imports? = true
|
|
43
|
+
|
|
44
|
+
include Archsight::Import::Handlers::CachePruner
|
|
45
|
+
|
|
46
|
+
# Gitea caps the page size (50 by default), so the listing runs until an empty page
|
|
47
|
+
PER_PAGE = 50
|
|
48
|
+
|
|
49
|
+
def execute
|
|
50
|
+
@host = config("host")
|
|
51
|
+
raise "Missing required config: host" unless @host
|
|
52
|
+
|
|
53
|
+
@token = ENV.fetch("GITEA_TOKEN", nil)
|
|
54
|
+
raise "Missing required environment variable: GITEA_TOKEN" unless @token
|
|
55
|
+
|
|
56
|
+
@org = config("org")
|
|
57
|
+
@scheme = config("scheme", default: "https")
|
|
58
|
+
@verify_ssl = config("verifySSL", default: "true").to_s != "false"
|
|
59
|
+
@rate_limit_ms = config("rateLimitMs", default: "0").to_i
|
|
60
|
+
@repo_output_path = config("repoOutputPath")
|
|
61
|
+
@child_cache_time = config("childCacheTime")
|
|
62
|
+
@default_visibility = config("defaultVisibility", default: "internal")
|
|
63
|
+
@host_dir = File.join(Archsight::Import.cache_root(config("cacheRoot")), "gitea", @host)
|
|
64
|
+
|
|
65
|
+
progress.update("Fetching repositories from #{@org || @host}")
|
|
66
|
+
repos = fetch_all_repos
|
|
67
|
+
|
|
68
|
+
if repos.empty?
|
|
69
|
+
progress.warn("No repositories found in #{@org || @host}")
|
|
70
|
+
return
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
prune_stale_cache(repos)
|
|
74
|
+
|
|
75
|
+
progress.update("Generating #{repos.size} import resources")
|
|
76
|
+
generate_repository_imports(repos)
|
|
77
|
+
|
|
78
|
+
write_generates_meta
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
private
|
|
82
|
+
|
|
83
|
+
def fetch_all_repos
|
|
84
|
+
repos = {}
|
|
85
|
+
page = 1
|
|
86
|
+
|
|
87
|
+
loop do
|
|
88
|
+
progress.update("Fetching repositories (page #{page})")
|
|
89
|
+
batch = fetch_repos_page(page)
|
|
90
|
+
break if batch.empty?
|
|
91
|
+
|
|
92
|
+
before = repos.size
|
|
93
|
+
batch.each { |repo| repos[repo["id"] || repo["fullName"]] = repo }
|
|
94
|
+
break if repos.size == before # a server that ignores `page` would repeat the first one forever
|
|
95
|
+
|
|
96
|
+
progress.update("Fetched #{repos.size} repositories")
|
|
97
|
+
page += 1
|
|
98
|
+
sleep(@rate_limit_ms / 1000.0) if @rate_limit_ms.positive?
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
repos.values
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def fetch_repos_page(page)
|
|
105
|
+
data = if @org
|
|
106
|
+
make_request("/orgs/#{URI.encode_www_form_component(@org)}/repos", page: page, limit: PER_PAGE)
|
|
107
|
+
else
|
|
108
|
+
# the search wraps the repositories: { ok: true, data: [...] }
|
|
109
|
+
make_request("/repos/search", page: page, limit: PER_PAGE)["data"]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
Array(data).map do |repo|
|
|
113
|
+
{
|
|
114
|
+
"id" => repo["id"],
|
|
115
|
+
"name" => repo["name"],
|
|
116
|
+
"fullName" => repo["full_name"],
|
|
117
|
+
"owner" => repo.dig("owner", "login") || repo["full_name"].to_s.split("/").first,
|
|
118
|
+
"isArchived" => repo["archived"],
|
|
119
|
+
"private" => repo["private"],
|
|
120
|
+
"sshUrl" => repo["ssh_url"],
|
|
121
|
+
"url" => repo["clone_url"] || repo["html_url"]
|
|
122
|
+
}
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def make_request(path, params = {})
|
|
127
|
+
uri = URI("#{@scheme}://#{@host}/api/v1#{path}")
|
|
128
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
129
|
+
|
|
130
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
131
|
+
http.use_ssl = uri.scheme == "https"
|
|
132
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl? && !@verify_ssl
|
|
133
|
+
|
|
134
|
+
request = Net::HTTP::Get.new(uri)
|
|
135
|
+
request["Authorization"] = "token #{@token}"
|
|
136
|
+
request["Accept"] = "application/json"
|
|
137
|
+
|
|
138
|
+
handle_response(http.request(request))
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def handle_response(response)
|
|
142
|
+
case response
|
|
143
|
+
when Net::HTTPSuccess
|
|
144
|
+
JSON.parse(response.body)
|
|
145
|
+
when Net::HTTPUnauthorized
|
|
146
|
+
raise "Gitea API error: 401 Unauthorized - Invalid or expired GITEA_TOKEN"
|
|
147
|
+
when Net::HTTPForbidden
|
|
148
|
+
raise "Gitea API error: 403 Forbidden - Check token permissions"
|
|
149
|
+
when Net::HTTPNotFound
|
|
150
|
+
raise "Gitea API error: 404 Not Found - #{@org ? "Organization '#{@org}'" : "API"} not found or not accessible on #{@host}"
|
|
151
|
+
else
|
|
152
|
+
raise "Gitea API error: #{response.code} #{response.message}"
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Each owner has its own directory; owners that are not listed are left alone
|
|
157
|
+
def prune_stale_cache(repos)
|
|
158
|
+
repos.group_by { |repo| repo["owner"] }.each do |owner, owned|
|
|
159
|
+
prune_stale_cache_entries(File.join(@host_dir, owner), owned.map { |repo| repo["name"] })
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def generate_repository_imports(repos)
|
|
164
|
+
yaml_documents = repos.map do |repo|
|
|
165
|
+
child_annotations = {}
|
|
166
|
+
child_annotations["import/outputPath"] = @repo_output_path if @repo_output_path
|
|
167
|
+
child_annotations["import/cacheTime"] = @child_cache_time if @child_cache_time
|
|
168
|
+
|
|
169
|
+
child_config = {
|
|
170
|
+
"path" => File.join(@host_dir, repo["owner"], repo["name"]),
|
|
171
|
+
"gitUrl" => repo["sshUrl"] || repo["url"],
|
|
172
|
+
"archived" => repo["isArchived"].to_s,
|
|
173
|
+
"visibility" => repo["private"] == false ? "open-source" : @default_visibility
|
|
174
|
+
}
|
|
175
|
+
child_config["fallbackTeam"] = config("fallbackTeam") if config("fallbackTeam")
|
|
176
|
+
child_config["botTeam"] = config("botTeam") if config("botTeam")
|
|
177
|
+
child_config["corporateAffixes"] = config("corporateAffixes") if config("corporateAffixes")
|
|
178
|
+
child_config["gitService"] = config("gitService", default: "Git:Gitea")
|
|
179
|
+
|
|
180
|
+
import_yaml(
|
|
181
|
+
name: "Import:Repo:gitea:#{repo["owner"]}:#{repo["name"]}",
|
|
182
|
+
handler: "repository",
|
|
183
|
+
config: child_config,
|
|
184
|
+
annotations: child_annotations
|
|
185
|
+
)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Add self-marker with generated/at for caching
|
|
189
|
+
yaml_documents << self_marker
|
|
190
|
+
|
|
191
|
+
write_yaml(yaml_documents.map { |doc| YAML.dump(doc) }.join("\n"))
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
Archsight::Import::Registry.register("gitea", Archsight::Import::Handlers::Gitea)
|
|
@@ -165,6 +165,7 @@ class Archsight::Import::Handlers::Github < Archsight::Import::Handler
|
|
|
165
165
|
child_config["fallbackTeam"] = config("fallbackTeam") if config("fallbackTeam")
|
|
166
166
|
child_config["botTeam"] = config("botTeam") if config("botTeam")
|
|
167
167
|
child_config["corporateAffixes"] = config("corporateAffixes") if config("corporateAffixes")
|
|
168
|
+
child_config["gitService"] = config("gitService", default: "Git:Github")
|
|
168
169
|
|
|
169
170
|
import_yaml(
|
|
170
171
|
name: "Import:Repo:github:#{@org}:#{repo_name}",
|
|
@@ -214,6 +214,7 @@ class Archsight::Import::Handlers::Gitlab < Archsight::Import::Handler
|
|
|
214
214
|
child_config["fallbackTeam"] = config("fallbackTeam") if config("fallbackTeam")
|
|
215
215
|
child_config["botTeam"] = config("botTeam") if config("botTeam")
|
|
216
216
|
child_config["corporateAffixes"] = config("corporateAffixes") if config("corporateAffixes")
|
|
217
|
+
child_config["gitService"] = config("gitService", default: "Git:Gitlab")
|
|
217
218
|
|
|
218
219
|
import_yaml(
|
|
219
220
|
name: "Import:Repo:gitlab:#{dir_name}",
|
|
@@ -356,10 +356,7 @@ class Archsight::Import::Handlers::Repository < Archsight::Import::Handler
|
|
|
356
356
|
spec = {}
|
|
357
357
|
|
|
358
358
|
# Technology component (Git provider)
|
|
359
|
-
if git_url
|
|
360
|
-
provider = git_url.include?("github") ? "Git:Github" : "Git:Gitlab"
|
|
361
|
-
spec["suppliedBy"] = { "technologyComponents" => [provider] }
|
|
362
|
-
end
|
|
359
|
+
spec["suppliedBy"] = { "technologyComponents" => [git_service(git_url)] } if git_url
|
|
363
360
|
|
|
364
361
|
# Team relations from contributor matching
|
|
365
362
|
if team_result
|
|
@@ -386,6 +383,12 @@ class Archsight::Import::Handlers::Repository < Archsight::Import::Handler
|
|
|
386
383
|
url_line.split("=").last.strip
|
|
387
384
|
end
|
|
388
385
|
|
|
386
|
+
# The TechnologyService that supplies the repository: `gitService` as passed by the listing import
|
|
387
|
+
# (github, gitlab, gitea), else guessed from the clone URL for repository imports written by hand
|
|
388
|
+
def git_service(git_url)
|
|
389
|
+
config("gitService") || (git_url.include?("github") ? "Git:Github" : "Git:Gitlab")
|
|
390
|
+
end
|
|
391
|
+
|
|
389
392
|
def repository_name(git_url_or_path)
|
|
390
393
|
if git_url_or_path.include?(":")
|
|
391
394
|
# Git URL format
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "diagram"
|
|
4
|
+
require_relative "helpers/diagram_blocks"
|
|
5
|
+
require_relative "helpers/asset_images"
|
|
6
|
+
|
|
7
|
+
module Archsight
|
|
8
|
+
# Estimated reading time of a markdown page: its words plus the diagrams (fenced ```asd blocks and embedded
|
|
9
|
+
# .asd files), which take longer the more nodes and edges they have.
|
|
10
|
+
module ReadingTime
|
|
11
|
+
WORDS_PER_MINUTE = 200
|
|
12
|
+
CODE_WEIGHT = 0.5 # code is read, but slower to count: every code word counts this much
|
|
13
|
+
SECONDS_PER_DIAGRAM = 10
|
|
14
|
+
SECONDS_PER_NODE = 3
|
|
15
|
+
SECONDS_PER_EDGE = 2
|
|
16
|
+
|
|
17
|
+
FENCE = /^[ \t]*(```|~~~)[^\n]*\n.*?^[ \t]*\1[ \t]*$/m
|
|
18
|
+
WORD = /\p{L}[\p{L}\p{N}'’-]*|\p{N}+/
|
|
19
|
+
MARKUP = /!\[[^\]]*\]\([^)]*\)|<[^>]+>|\{[a-z]+:[^}]*\}|https?:\/\/\S+/
|
|
20
|
+
|
|
21
|
+
# @return [Hash] `{ minutes:, words:, diagrams: }`; minutes is rounded up, at least 1
|
|
22
|
+
def self.estimate(markdown, base_dir: nil, resources_dir: nil, includes: nil)
|
|
23
|
+
markdown = markdown.to_s
|
|
24
|
+
prose, code = split(markdown)
|
|
25
|
+
words = count(prose)
|
|
26
|
+
sources = Helpers::DiagramBlocks.sources(markdown) + embedded(markdown, base_dir, resources_dir)
|
|
27
|
+
seconds = (words + (count(code) * CODE_WEIGHT)) * 60.0 / WORDS_PER_MINUTE
|
|
28
|
+
seconds += sources.sum { |source| diagram_seconds(source, includes) }
|
|
29
|
+
{ minutes: [(seconds / 60.0).ceil, 1].max, words: words, diagrams: sources.size }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Splits the markdown into prose and the text of non-diagram code blocks (diagram blocks are counted separately).
|
|
33
|
+
def self.split(markdown)
|
|
34
|
+
code = []
|
|
35
|
+
prose = markdown.gsub(FENCE) do |block|
|
|
36
|
+
code << block unless block.match?(/\A[ \t]*(?:```|~~~)asd\b/)
|
|
37
|
+
" "
|
|
38
|
+
end
|
|
39
|
+
[prose.gsub(MARKUP, " "), code.join("\n")]
|
|
40
|
+
end
|
|
41
|
+
private_class_method :split
|
|
42
|
+
|
|
43
|
+
def self.count(text)
|
|
44
|
+
text.scan(WORD).size
|
|
45
|
+
end
|
|
46
|
+
private_class_method :count
|
|
47
|
+
|
|
48
|
+
def self.embedded(markdown, base_dir, resources_dir)
|
|
49
|
+
return [] unless resources_dir
|
|
50
|
+
|
|
51
|
+
Helpers::AssetImages.asd_files(markdown, base_dir: base_dir, resources_dir: resources_dir).filter_map do |_path, file|
|
|
52
|
+
source = File.read(file, encoding: "UTF-8") if File.size(file) <= Helpers::AssetImages::MAX_ASD
|
|
53
|
+
source if source&.valid_encoding?
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
private_class_method :embedded
|
|
57
|
+
|
|
58
|
+
def self.diagram_seconds(source, includes)
|
|
59
|
+
graph = Diagram::Graph.build(Diagram.expand(source, includes: includes).statements)
|
|
60
|
+
SECONDS_PER_DIAGRAM + (graph.nodes_by_id.size * SECONDS_PER_NODE) + (graph.edges.size * SECONDS_PER_EDGE)
|
|
61
|
+
rescue Diagram::Error
|
|
62
|
+
SECONDS_PER_DIAGRAM
|
|
63
|
+
end
|
|
64
|
+
private_class_method :diagram_seconds
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -28,6 +28,7 @@ class Archsight::Resources::ImplementationWorkPackage < Archsight::Resources::Ba
|
|
|
28
28
|
|
|
29
29
|
- `ownedBy` the accountable actor or role, `performedBy` the actors or roles that carry it out
|
|
30
30
|
- `realizes` deliverables (its results), requirements and goals
|
|
31
|
+
- `plans` the requirements it will meet but does not yet: the "Requirements" table and `requirements` blocks show them as "planned" (`realizes` shows "implemented"); move them to `realizes` when the work is done
|
|
31
32
|
- `affects` the assets it changes, for example the `TechnologyEquipment` a project installs; the assessments (risks, findings) it treats are `mitigatedBy` it (written on the assessment)
|
|
32
33
|
- `triggers` the work packages that follow it; an `ImplementationEvent` can trigger it
|
|
33
34
|
- A `ImplementationGap` is `closedBy` it
|
|
@@ -74,6 +75,7 @@ class Archsight::Resources::ImplementationWorkPackage < Archsight::Resources::Ba
|
|
|
74
75
|
relation :performedBy, :businessRoles, :BusinessRole
|
|
75
76
|
relation :realizes, :implementationDeliverables, :ImplementationDeliverable
|
|
76
77
|
relation :realizes, :motivationRequirements, :MotivationRequirement
|
|
78
|
+
relation :plans, :motivationRequirements, :MotivationRequirement
|
|
77
79
|
relation :realizes, :goals, :MotivationGoal
|
|
78
80
|
relation :affects, :businessProcesses, :BusinessProcess
|
|
79
81
|
relation :affects, :applicationComponents, :ApplicationComponent
|
data/lib/archsight/version.rb
CHANGED
|
@@ -313,6 +313,10 @@ paths:
|
|
|
313
313
|
tags:
|
|
314
314
|
- howto
|
|
315
315
|
- wiki
|
|
316
|
+
reading:
|
|
317
|
+
minutes: 2
|
|
318
|
+
words: 310
|
|
319
|
+
diagrams: 1
|
|
316
320
|
toc:
|
|
317
321
|
- level: 2
|
|
318
322
|
id: create-a-page
|
|
@@ -2289,7 +2293,7 @@ components:
|
|
|
2289
2293
|
|
|
2290
2294
|
PageResponse:
|
|
2291
2295
|
type: object
|
|
2292
|
-
required: [name, title, status, author, owner, created, updated, properties, links, tags, slides, toc, breadcrumb, html, backlinks]
|
|
2296
|
+
required: [name, title, status, author, owner, created, updated, properties, links, tags, slides, reading, toc, breadcrumb, html, backlinks]
|
|
2293
2297
|
properties:
|
|
2294
2298
|
name:
|
|
2295
2299
|
type: string
|
|
@@ -2344,6 +2348,21 @@ components:
|
|
|
2344
2348
|
- $ref: '#/components/schemas/PageSlides'
|
|
2345
2349
|
- type: 'null'
|
|
2346
2350
|
description: The slide deck of the page, null if it has none or the file cannot be served
|
|
2351
|
+
reading:
|
|
2352
|
+
type: object
|
|
2353
|
+
description: Estimated reading time of the body, its words plus its `asd` diagrams (more nodes and edges take longer)
|
|
2354
|
+
required: [minutes, words, diagrams]
|
|
2355
|
+
properties:
|
|
2356
|
+
minutes:
|
|
2357
|
+
type: integer
|
|
2358
|
+
minimum: 1
|
|
2359
|
+
description: Rounded up, at least 1
|
|
2360
|
+
words:
|
|
2361
|
+
type: integer
|
|
2362
|
+
description: Words of the text (code blocks and diagram sources not included)
|
|
2363
|
+
diagrams:
|
|
2364
|
+
type: integer
|
|
2365
|
+
description: Number of `asd` diagrams (fenced blocks and embedded `.asd` files)
|
|
2347
2366
|
toc:
|
|
2348
2367
|
type: array
|
|
2349
2368
|
description: Headings of the body; empty unless the frontmatter has `toc` `yes`
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "../../page_tree"
|
|
4
4
|
require_relative "../../slides"
|
|
5
|
+
require_relative "../../reading_time"
|
|
5
6
|
|
|
6
7
|
module Archsight; end
|
|
7
8
|
module Archsight::Web; end
|
|
@@ -33,6 +34,7 @@ module Archsight::Web::API::PageHelpers
|
|
|
33
34
|
annotations = page.annotations
|
|
34
35
|
body = strip_duplicate_title(annotations["page/content"].to_s, page)
|
|
35
36
|
tree = Archsight::PageTree.new(db)
|
|
37
|
+
base = Archsight::Assets.base_dir_for(page, resources_dir: Archsight.resources_dir)
|
|
36
38
|
{
|
|
37
39
|
name: page.name,
|
|
38
40
|
title: page.title,
|
|
@@ -45,9 +47,11 @@ module Archsight::Web::API::PageHelpers
|
|
|
45
47
|
links: annotations.select { |key, _| key.start_with?("link/") }.transform_keys { |key| key.delete_prefix("link/") },
|
|
46
48
|
tags: Archsight::Resources::Page.annotation_matching("page/tags")&.value_for(page) || [],
|
|
47
49
|
slides: Archsight::Slides.for_page(page),
|
|
50
|
+
reading: Archsight::ReadingTime.estimate(body, base_dir: base, resources_dir: Archsight.resources_dir,
|
|
51
|
+
includes: Archsight::Helpers::DiagramIncludes.for(db)),
|
|
48
52
|
toc: annotations["page/toc"] == "yes" ? Archsight::PageTree.toc(body) : [],
|
|
49
53
|
breadcrumb: tree.breadcrumb(page),
|
|
50
|
-
html: markdown(body, base:
|
|
54
|
+
html: markdown(body, base: base, page: page),
|
|
51
55
|
backlinks: page_backlinks(page)
|
|
52
56
|
}
|
|
53
57
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,L as t,R as n,X as r,it as i,p as a,t as o,tt as s}from"./index-
|
|
1
|
+
import{B as e,L as t,R as n,X as r,it as i,p as a,t as o,tt as s}from"./index-JZkWwfYg.js";import{t as c}from"./WikiPage-DSEL2gmd.js";var l={key:1},u={__name:`DocPage`,props:{filename:String},setup(u){let d=u,f=i(null);function p(e,t){let n=new DOMParser().parseFromString(e,`text/html`).body,r=n.querySelector(`:scope > article`)||n,i=r.querySelector(`h1`),a=i?.textContent.trim()||t.split(`/`).pop().replace(/[-_]/g,` `);i?.remove();let o=[...r.querySelectorAll(`h2[id], h3[id], h4[id]`)].map(e=>({level:Number(e.tagName[1]),id:e.id,text:e.textContent.trim()})),s=[{title:`Documentation`}];return t.startsWith(`resources/`)&&s.push({title:`Resource types`}),{title:a,html:r.innerHTML,toc:o.length>=2?o:[],breadcrumb:s}}async function m(){let e=await a(d.filename);f.value=e?p(e,d.filename):{title:`Not found`,html:`<p>Documentation not found.</p>`,toc:[],breadcrumb:[{title:`Documentation`}]},o(f.value.title)}return s(()=>d.filename,m,{immediate:!0}),(i,a)=>f.value?(r(),n(c,{key:0,title:f.value.title,html:f.value.html,breadcrumb:f.value.breadcrumb,toc:f.value.toc},null,8,[`title`,`html`,`breadcrumb`,`toc`])):(r(),e(`article`,l,[...a[0]||=[t(`p`,null,`Loading...`,-1)]]))}};export{u as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{$ as n,A as r,B as i,E as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,P as p,R as m,T as h,U as g,X as _,Y as v,Z as y,a as b,at as x,ct as S,d as C,f as w,h as ee,it as T,j as te,k as ne,m as re,nt as ie,ot as E,q as ae,rt as oe,tt as se,z as D}from"./index-le1guGp1.js";import{t as ce}from"./useHighlight-BH32C7yt.js";var le=`archsight.diagramPreview.layout`,ue=[`bottom`,`right`,`full`,`hidden`],de=`(min-width: 1400px)`;function fe(){try{let e=localStorage.getItem(le);return ue.includes(e)?e:null}catch{return null}}var pe=T(fe()),me=T(typeof matchMedia==`function`&&matchMedia(de).matches);typeof matchMedia==`function`&&matchMedia(de).addEventListener(`change`,e=>{me.value=e.matches});var he=c(()=>pe.value||(me.value?`right`:`bottom`));function ge(e){if(ue.includes(e)){pe.value=e;try{localStorage.setItem(le,e)}catch{}}}function _e(){return{layout:he,setLayout:ge}}var ve={class:`preview-head`},ye={class:`preview-tools`},be={key:0,class:`preview-state`},xe={class:`preview-layout`,role:`group`,"aria-label":`Preview layout`},Se=[`aria-pressed`,`title`,`aria-label`,`onClick`],Ce={key:0,class:`preview-error`,role:`alert`},we=[`innerHTML`],Te={key:2,class:`preview-empty`},Ee=300,De=b({__name:`DiagramPreview`,props:{source:String},setup(e){let t=e,{layout:n,setLayout:r}=_e(),a=c(()=>n.value===`hidden`),o=[{value:`bottom`,icon:`iconoir-table-rows`,label:`Below the editor`},{value:`right`,icon:`iconoir-view-columns-2`,label:`Right of the editor`},{value:`full`,icon:`iconoir-expand`,label:`Preview only`},{value:`hidden`,icon:`iconoir-eye-closed`,label:`Hide preview`}],l=T(``),u=T(null),f=T(!1),m=null,g=null;function v(){clearTimeout(m),m=null,g?.abort(),g=null}async function b(e){g=new AbortController;let t=g;f.value=!0;try{let n=await h(e,{signal:t.signal});if(t!==g)return;n.html&&(l.value=n.html),u.value=n.error}catch(e){if(e.name===`AbortError`||t!==g)return;u.value=e.message}finally{t===g&&(f.value=!1)}}se([()=>t.source,a],([e,t],[,n])=>{v(),t?f.value=!1:!e||!e.trim()?(l.value=``,u.value=null,f.value=!1):(f.value=!0,m=setTimeout(()=>b(e),n?0:Ee))},{immediate:!0}),ae(v);function C(e){e.target.closest(`a`)&&e.preventDefault()}return(e,t)=>(_(),i(`div`,{class:E([`diagram-preview`,`layout-${x(n)}`])},[d(`div`,ve,[d(`span`,null,[t[0]||=d(`i`,{class:`iconoir-eye`},null,-1),t[1]||=s(` Preview`,-1),a.value?(_(),i(p,{key:0},[s(` hidden`)],64)):D(``,!0)]),d(`span`,ye,[f.value&&!a.value?(_(),i(`span`,be,`Rendering…`)):D(``,!0),d(`span`,xe,[(_(!0),i(p,null,y(o.filter(e=>!a.value||e.value!==`hidden`),e=>(_(),i(`button`,{key:e.value,type:`button`,class:E({active:x(n)===e.value}),"aria-pressed":x(n)===e.value,title:e.label,"aria-label":e.label,onClick:t=>x(r)(e.value)},[d(`i`,{class:E(e.icon)},null,2)],10,Se))),128))])])]),a.value?D(``,!0):(_(),i(p,{key:0},[u.value?(_(),i(`div`,Ce,[t[2]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),s(` `+S(u.value),1)])):D(``,!0),l.value?(_(),i(`div`,{key:1,class:E([`preview-body`,{stale:!!u.value}]),title:`Links are disabled in the preview`,onClick:C,innerHTML:l.value},null,10,we)):!u.value&&!f.value?(_(),i(`p`,Te,`Nothing to preview yet.`)):D(``,!0)],64))],2))}},[[`__scopeId`,`data-v-11568657`]]),Oe={class:`label-row`},ke=[`for`,`title`],Ae={key:0,class:`required`},je=[`id`,`aria-invalid`],Me=[`value`],Ne=[`id`,`aria-invalid`,`placeholder`],Pe={key:0,class:`future-hint`},Fe={class:`code-source`},Ie=[`id`,`aria-invalid`,`placeholder`],Le={class:`future-hint`},Re=[`id`,`step`,`aria-invalid`],ze=[`id`,`aria-invalid`],Be=[`id`,`aria-invalid`],Ve=[`id`,`aria-invalid`],He={key:7,class:`field-description`},Ue={key:8,class:`field-error`},We=b({__name:`EditorField`,props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:[`update:modelValue`,`openMarkdown`],setup(e,{emit:t}){let n=e,a=t,o=c({get:()=>n.modelValue??``,set:e=>a(`update:modelValue`,e)}),l=c(()=>[`textarea`,`markdown`,`code`].includes(n.field.input_type)),u=c(()=>n.field.key===`page/content`),f=c(()=>n.field.code_language===`asd`),{layout:h}=_e(),g={asd:`Archsight Diagram`},v=c(()=>{let e=n.field.code_language||``;return g[e]||e.charAt(0).toUpperCase()+e.slice(1)}),b=c(()=>n.error&&n.error.length>0);return(t,n)=>(_(),i(`div`,{class:E([`field-group`,{"field-full-width":l.value}])},[d(`div`,Oe,[d(`label`,{for:e.field.key,title:e.field.description},[s(S(e.field.title)+` `,1),e.field.required?(_(),i(`span`,Ae,`*`)):D(``,!0)],8,ke),e.field.input_type===`markdown`?(_(),i(`button`,{key:0,type:`button`,class:`btn-edit-markdown`,title:`Open rich text editor`,onClick:n[0]||=n=>t.$emit(`openMarkdown`,e.field.key)},[...n[8]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit `,-1)]])):D(``,!0)]),e.field.input_type===`select`?oe((_(),i(`select`,{key:0,id:e.field.key,"onUpdate:modelValue":n[1]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},[n[9]||=d(`option`,{value:``},`Select...`,-1),(_(!0),i(p,null,y(e.field.options,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Me))),128))],8,je)),[[r,o.value]]):e.field.input_type===`textarea`||e.field.input_type===`markdown`?(_(),i(`div`,{key:1,class:E([`markdown-field`,{"page-body":u.value}])},[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[2]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:e.field.input_type===`markdown`?`Enter markdown content...`:`One entry per line...`},null,8,Ne),[[te,o.value]]),e.field.input_type===`markdown`?(_(),i(`small`,Pe,[...n[10]||=[d(`i`,{class:`iconoir-info-circle`},null,-1),s(` Markdown, `,-1),d(`code`,null,`[[links]]`,-1),s(` and `,-1),d(`code`,null,"```asd",-1),s(` diagrams. Use Edit for the rich text editor `,-1)]])):D(``,!0)],2)):e.field.input_type===`code`?(_(),i(`div`,{key:2,class:E([`code-field`,f.value&&[`with-preview`,`layout-${x(h)}`]])},[d(`div`,Fe,[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[3]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:`Enter ${e.field.code_language||``} code...`,spellcheck:`false`},null,8,Ie),[[te,o.value]]),d(`small`,Le,[n[11]||=d(`i`,{class:`iconoir-code`},null,-1),s(` `+S(v.value)+` code `,1)])]),f.value?(_(),m(De,{key:0,class:`field-diagram-preview`,source:String(o.value)},null,8,[`source`])):D(``,!0)],2)):e.field.input_type===`number`?oe((_(),i(`input`,{key:3,id:e.field.key,type:`number`,"onUpdate:modelValue":n[4]||=e=>o.value=e,step:e.field.step,"aria-invalid":b.value?`true`:void 0},null,8,Re)),[[te,o.value]]):e.field.input_type===`url`?oe((_(),i(`input`,{key:4,id:e.field.key,type:`url`,"onUpdate:modelValue":n[5]||=e=>o.value=e,placeholder:`https://...`,"aria-invalid":b.value?`true`:void 0},null,8,ze)),[[te,o.value]]):e.field.input_type===`list`?oe((_(),i(`input`,{key:5,id:e.field.key,type:`text`,"onUpdate:modelValue":n[6]||=e=>o.value=e,placeholder:`Comma-separated values`,"aria-invalid":b.value?`true`:void 0},null,8,Be)),[[te,o.value]]):oe((_(),i(`input`,{key:6,id:e.field.key,type:`text`,"onUpdate:modelValue":n[7]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},null,8,Ve)),[[te,o.value]]),e.field.description&&![`textarea`,`markdown`,`code`].includes(e.field.input_type)?(_(),i(`small`,He,S(e.field.description),1)):D(``,!0),b.value?(_(),i(`div`,Ue,S(e.error.join(`, `)),1)):D(``,!0)],2))}},[[`__scopeId`,`data-v-fe1221de`]]),Ge={class:`relations-editor`},Ke={key:0,class:`no-relations`},qe={id:`relations-list`},Je={class:`relation-text`},Ye=[`onClick`],Xe={class:`add-relation-row`},Ze=[`value`],Qe=[`value`],$e=b({__name:`EditorRelations`,props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:[`update:relations`],setup(e,{emit:t}){let n=e,a=t,o=T(``),l=T(``),u=c(()=>[...n.relations].sort((e,t)=>(e.verb+e.kind+e.name).localeCompare(t.verb+t.kind+t.name))),f=c(()=>o.value?n.relationOptions.find(e=>e.combo===o.value)?.target_kind:null),m=c(()=>f.value&&n.instancesByKind[f.value]||[]);se(o,()=>{l.value=``});function h(){if(!o.value||!l.value)return;let e=n.relationOptions.find(e=>e.combo===o.value);if(!e||n.relations.some(t=>t.verb===e.verb&&t.kind===e.target_kind&&t.name===l.value))return;let t=[...n.relations,{verb:e.verb,kind:e.target_kind,name:l.value}];a(`update:relations`,t),o.value=``,l.value=``}function g(e){let t=n.relations.filter((t,n)=>n!==e);a(`update:relations`,t)}return(t,n)=>(_(),i(`div`,Ge,[!e.relationOptions||e.relationOptions.length===0?(_(),i(`p`,Ke,` This resource type has no defined relations. `)):(_(),i(p,{key:1},[d(`div`,qe,[(_(!0),i(p,null,y(u.value,(e,t)=>(_(),i(`div`,{key:`${e.verb}:${e.kind}:${e.name}`,class:`relation-item`},[d(`span`,Je,[d(`strong`,null,S(e.verb),1),s(` → `+S(e.kind)+`: `,1),d(`em`,null,S(e.name),1)]),d(`button`,{class:`btn-remove`,type:`button`,title:`Remove`,onClick:e=>g(t)},[...n[2]||=[d(`i`,{class:`iconoir-xmark`},null,-1)]],8,Ye)]))),128))]),d(`div`,Xe,[oe(d(`select`,{"onUpdate:modelValue":n[0]||=e=>o.value=e},[n[3]||=d(`option`,{value:``},`Select relation...`,-1),(_(!0),i(p,null,y(e.relationOptions,e=>(_(),i(`option`,{key:e.combo,value:e.combo},S(e.verb)+` → `+S(e.target_kind),9,Ze))),128))],512),[[r,o.value]]),oe(d(`select`,{"onUpdate:modelValue":n[1]||=e=>l.value=e},[n[4]||=d(`option`,{value:``},`Select instance...`,-1),(_(!0),i(p,null,y(m.value,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Qe))),128))],512),[[r,l.value]]),d(`button`,{class:`secondary btn-add`,type:`button`,onClick:h},[...n[5]||=[d(`i`,{class:`iconoir-plus`},null,-1),s(` Add `,-1)]])])],64))]))}},[[`__scopeId`,`data-v-a987a6fe`]]),et={class:`yaml-output-container`},tt={key:0,class:`conflict-error`},nt={class:`yaml-success`},rt={id:`yaml-content`},it={key:0,class:`yaml-file-info`},at={key:1,class:`yaml-instructions`},ot={class:`yaml-actions`},st=[`disabled`],ct=b({__name:`EditorYamlOutput`,props:{yaml:String,format:{type:String,default:`yaml`},kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:[`editAgain`],setup(e,{emit:t}){let n=e,r=T(null),o=T(`idle`),f=T(`idle`),m=T(null),h=c(()=>n.format===`markdown`),g=c(()=>h.value?`Markdown`:`YAML`),v=c(()=>h.value?`.md`:`.yaml`);l(()=>{r.value&&ce(r.value)}),se(()=>n.yaml,async()=>{await u(),r.value&&ce(r.value)});async function y(){try{await navigator.clipboard.writeText(n.yaml),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}catch{let e=document.createElement(`textarea`);e.value=n.yaml,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}}async function b(){f.value=`saving`,m.value=null;try{let e=await a(n.kind,n.name,n.yaml,n.contentHash);e.success?(f.value=`saved`,setTimeout(()=>{f.value=`idle`},2e3)):e.conflict?(m.value=e.error,f.value=`idle`):(alert(`Save failed: `+e.error),f.value=`idle`)}catch(e){alert(`Save failed: `+e.message),f.value=`idle`}}return(t,n)=>(_(),i(`div`,et,[m.value?(_(),i(`div`,tt,[n[1]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),d(`span`,null,S(m.value),1)])):D(``,!0),d(`p`,nt,[n[2]||=d(`i`,{class:`iconoir-check-circle`},null,-1),s(` Generated `+S(g.value),1)]),d(`div`,{ref_key:`codeEl`,ref:r},[d(`pre`,rt,[d(`code`,{class:E(`language-${e.format}`)},S(e.yaml),3)])],512),d(`footer`,null,[e.pathRef?(_(),i(`p`,it,[n[3]||=d(`i`,{class:`iconoir-folder`},null,-1),d(`span`,null,`Source: `+S(e.pathRef),1)])):(_(),i(`p`,at,[n[10]||=d(`i`,{class:`iconoir-info-circle`},null,-1),d(`span`,null,[s(` Copy this `+S(g.value)+` and save it to a `,1),d(`code`,null,S(v.value),1),n[6]||=s(` file in your resources directory`,-1),h.value?(_(),i(p,{key:0},[n[4]||=s(` (named `,-1),d(`code`,null,S(e.name)+`.md`,1),n[5]||=s(`)`,-1)],64)):D(``,!0),n[7]||=s(`, `,-1),n[8]||=d(`br`,null,null,-1),n[9]||=s(`then reload the application. `,-1)])])),d(`div`,ot,[e.pathRef&&e.inlineEditEnabled?(_(),i(`button`,{key:0,type:`button`,onClick:b,disabled:f.value===`saving`,class:E({saved:f.value===`saved`})},[d(`i`,{class:E(f.value===`saving`?`iconoir-refresh`:f.value===`saved`?`iconoir-check`:`iconoir-check-circle`)},null,2),s(` `+S(f.value===`saving`?`Saving...`:f.value===`saved`?`Saved!`:`Save to File`),1)],10,st)):D(``,!0),d(`button`,{type:`button`,onClick:y,class:E({copied:o.value===`copied`})},[d(`i`,{class:E(o.value===`copied`?`iconoir-check`:`iconoir-copy`)},null,2),s(` `+S(o.value===`copied`?`Copied!`:`Copy to Clipboard`),1)],2),d(`button`,{class:`secondary`,type:`button`,onClick:n[0]||=e=>t.$emit(`editAgain`)},[...n[11]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit Again `,-1)]])])])]))}},[[`__scopeId`,`data-v-b5ea938f`]]);function O(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ut=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,dt=ut&&`documentMode`in document?document.documentMode:null,ft=ut&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pt=ut&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),mt=!(!ut||!(`InputEvent`in window)||dt)&&`getTargetRanges`in new window.InputEvent(`input`),ht=ut&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gt=ut&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_t=ut&&/Android/.test(navigator.userAgent),vt=ut&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yt=ut&&_t&&vt,bt=ut&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ft&&!vt,xt=0,St=1,Ct=2,wt=1,Tt=2,Et=3,Dt=4,Ot=5,kt=6,At=ht||gt||bt?`\xA0`:``,jt=`
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{$ as n,A as r,B as i,E as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,P as p,R as m,T as h,U as g,X as _,Y as v,Z as y,a as b,at as x,ct as S,d as C,f as w,h as ee,it as T,j as te,k as ne,m as re,nt as ie,ot as E,q as ae,rt as oe,tt as se,z as D}from"./index-JZkWwfYg.js";import{t as ce}from"./useHighlight-BH32C7yt.js";var le=`archsight.diagramPreview.layout`,ue=[`bottom`,`right`,`full`,`hidden`],de=`(min-width: 1400px)`;function fe(){try{let e=localStorage.getItem(le);return ue.includes(e)?e:null}catch{return null}}var pe=T(fe()),me=T(typeof matchMedia==`function`&&matchMedia(de).matches);typeof matchMedia==`function`&&matchMedia(de).addEventListener(`change`,e=>{me.value=e.matches});var he=c(()=>pe.value||(me.value?`right`:`bottom`));function ge(e){if(ue.includes(e)){pe.value=e;try{localStorage.setItem(le,e)}catch{}}}function _e(){return{layout:he,setLayout:ge}}var ve={class:`preview-head`},ye={class:`preview-tools`},be={key:0,class:`preview-state`},xe={class:`preview-layout`,role:`group`,"aria-label":`Preview layout`},Se=[`aria-pressed`,`title`,`aria-label`,`onClick`],Ce={key:0,class:`preview-error`,role:`alert`},we=[`innerHTML`],Te={key:2,class:`preview-empty`},Ee=300,De=b({__name:`DiagramPreview`,props:{source:String},setup(e){let t=e,{layout:n,setLayout:r}=_e(),a=c(()=>n.value===`hidden`),o=[{value:`bottom`,icon:`iconoir-table-rows`,label:`Below the editor`},{value:`right`,icon:`iconoir-view-columns-2`,label:`Right of the editor`},{value:`full`,icon:`iconoir-expand`,label:`Preview only`},{value:`hidden`,icon:`iconoir-eye-closed`,label:`Hide preview`}],l=T(``),u=T(null),f=T(!1),m=null,g=null;function v(){clearTimeout(m),m=null,g?.abort(),g=null}async function b(e){g=new AbortController;let t=g;f.value=!0;try{let n=await h(e,{signal:t.signal});if(t!==g)return;n.html&&(l.value=n.html),u.value=n.error}catch(e){if(e.name===`AbortError`||t!==g)return;u.value=e.message}finally{t===g&&(f.value=!1)}}se([()=>t.source,a],([e,t],[,n])=>{v(),t?f.value=!1:!e||!e.trim()?(l.value=``,u.value=null,f.value=!1):(f.value=!0,m=setTimeout(()=>b(e),n?0:Ee))},{immediate:!0}),ae(v);function C(e){e.target.closest(`a`)&&e.preventDefault()}return(e,t)=>(_(),i(`div`,{class:E([`diagram-preview`,`layout-${x(n)}`])},[d(`div`,ve,[d(`span`,null,[t[0]||=d(`i`,{class:`iconoir-eye`},null,-1),t[1]||=s(` Preview`,-1),a.value?(_(),i(p,{key:0},[s(` hidden`)],64)):D(``,!0)]),d(`span`,ye,[f.value&&!a.value?(_(),i(`span`,be,`Rendering…`)):D(``,!0),d(`span`,xe,[(_(!0),i(p,null,y(o.filter(e=>!a.value||e.value!==`hidden`),e=>(_(),i(`button`,{key:e.value,type:`button`,class:E({active:x(n)===e.value}),"aria-pressed":x(n)===e.value,title:e.label,"aria-label":e.label,onClick:t=>x(r)(e.value)},[d(`i`,{class:E(e.icon)},null,2)],10,Se))),128))])])]),a.value?D(``,!0):(_(),i(p,{key:0},[u.value?(_(),i(`div`,Ce,[t[2]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),s(` `+S(u.value),1)])):D(``,!0),l.value?(_(),i(`div`,{key:1,class:E([`preview-body`,{stale:!!u.value}]),title:`Links are disabled in the preview`,onClick:C,innerHTML:l.value},null,10,we)):!u.value&&!f.value?(_(),i(`p`,Te,`Nothing to preview yet.`)):D(``,!0)],64))],2))}},[[`__scopeId`,`data-v-11568657`]]),Oe={class:`label-row`},ke=[`for`,`title`],Ae={key:0,class:`required`},je=[`id`,`aria-invalid`],Me=[`value`],Ne=[`id`,`aria-invalid`,`placeholder`],Pe={key:0,class:`future-hint`},Fe={class:`code-source`},Ie=[`id`,`aria-invalid`,`placeholder`],Le={class:`future-hint`},Re=[`id`,`step`,`aria-invalid`],ze=[`id`,`aria-invalid`],Be=[`id`,`aria-invalid`],Ve=[`id`,`aria-invalid`],He={key:7,class:`field-description`},Ue={key:8,class:`field-error`},We=b({__name:`EditorField`,props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:[`update:modelValue`,`openMarkdown`],setup(e,{emit:t}){let n=e,a=t,o=c({get:()=>n.modelValue??``,set:e=>a(`update:modelValue`,e)}),l=c(()=>[`textarea`,`markdown`,`code`].includes(n.field.input_type)),u=c(()=>n.field.key===`page/content`),f=c(()=>n.field.code_language===`asd`),{layout:h}=_e(),g={asd:`Archsight Diagram`},v=c(()=>{let e=n.field.code_language||``;return g[e]||e.charAt(0).toUpperCase()+e.slice(1)}),b=c(()=>n.error&&n.error.length>0);return(t,n)=>(_(),i(`div`,{class:E([`field-group`,{"field-full-width":l.value}])},[d(`div`,Oe,[d(`label`,{for:e.field.key,title:e.field.description},[s(S(e.field.title)+` `,1),e.field.required?(_(),i(`span`,Ae,`*`)):D(``,!0)],8,ke),e.field.input_type===`markdown`?(_(),i(`button`,{key:0,type:`button`,class:`btn-edit-markdown`,title:`Open rich text editor`,onClick:n[0]||=n=>t.$emit(`openMarkdown`,e.field.key)},[...n[8]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit `,-1)]])):D(``,!0)]),e.field.input_type===`select`?oe((_(),i(`select`,{key:0,id:e.field.key,"onUpdate:modelValue":n[1]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},[n[9]||=d(`option`,{value:``},`Select...`,-1),(_(!0),i(p,null,y(e.field.options,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Me))),128))],8,je)),[[r,o.value]]):e.field.input_type===`textarea`||e.field.input_type===`markdown`?(_(),i(`div`,{key:1,class:E([`markdown-field`,{"page-body":u.value}])},[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[2]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:e.field.input_type===`markdown`?`Enter markdown content...`:`One entry per line...`},null,8,Ne),[[te,o.value]]),e.field.input_type===`markdown`?(_(),i(`small`,Pe,[...n[10]||=[d(`i`,{class:`iconoir-info-circle`},null,-1),s(` Markdown, `,-1),d(`code`,null,`[[links]]`,-1),s(` and `,-1),d(`code`,null,"```asd",-1),s(` diagrams. Use Edit for the rich text editor `,-1)]])):D(``,!0)],2)):e.field.input_type===`code`?(_(),i(`div`,{key:2,class:E([`code-field`,f.value&&[`with-preview`,`layout-${x(h)}`]])},[d(`div`,Fe,[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[3]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:`Enter ${e.field.code_language||``} code...`,spellcheck:`false`},null,8,Ie),[[te,o.value]]),d(`small`,Le,[n[11]||=d(`i`,{class:`iconoir-code`},null,-1),s(` `+S(v.value)+` code `,1)])]),f.value?(_(),m(De,{key:0,class:`field-diagram-preview`,source:String(o.value)},null,8,[`source`])):D(``,!0)],2)):e.field.input_type===`number`?oe((_(),i(`input`,{key:3,id:e.field.key,type:`number`,"onUpdate:modelValue":n[4]||=e=>o.value=e,step:e.field.step,"aria-invalid":b.value?`true`:void 0},null,8,Re)),[[te,o.value]]):e.field.input_type===`url`?oe((_(),i(`input`,{key:4,id:e.field.key,type:`url`,"onUpdate:modelValue":n[5]||=e=>o.value=e,placeholder:`https://...`,"aria-invalid":b.value?`true`:void 0},null,8,ze)),[[te,o.value]]):e.field.input_type===`list`?oe((_(),i(`input`,{key:5,id:e.field.key,type:`text`,"onUpdate:modelValue":n[6]||=e=>o.value=e,placeholder:`Comma-separated values`,"aria-invalid":b.value?`true`:void 0},null,8,Be)),[[te,o.value]]):oe((_(),i(`input`,{key:6,id:e.field.key,type:`text`,"onUpdate:modelValue":n[7]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},null,8,Ve)),[[te,o.value]]),e.field.description&&![`textarea`,`markdown`,`code`].includes(e.field.input_type)?(_(),i(`small`,He,S(e.field.description),1)):D(``,!0),b.value?(_(),i(`div`,Ue,S(e.error.join(`, `)),1)):D(``,!0)],2))}},[[`__scopeId`,`data-v-fe1221de`]]),Ge={class:`relations-editor`},Ke={key:0,class:`no-relations`},qe={id:`relations-list`},Je={class:`relation-text`},Ye=[`onClick`],Xe={class:`add-relation-row`},Ze=[`value`],Qe=[`value`],$e=b({__name:`EditorRelations`,props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:[`update:relations`],setup(e,{emit:t}){let n=e,a=t,o=T(``),l=T(``),u=c(()=>[...n.relations].sort((e,t)=>(e.verb+e.kind+e.name).localeCompare(t.verb+t.kind+t.name))),f=c(()=>o.value?n.relationOptions.find(e=>e.combo===o.value)?.target_kind:null),m=c(()=>f.value&&n.instancesByKind[f.value]||[]);se(o,()=>{l.value=``});function h(){if(!o.value||!l.value)return;let e=n.relationOptions.find(e=>e.combo===o.value);if(!e||n.relations.some(t=>t.verb===e.verb&&t.kind===e.target_kind&&t.name===l.value))return;let t=[...n.relations,{verb:e.verb,kind:e.target_kind,name:l.value}];a(`update:relations`,t),o.value=``,l.value=``}function g(e){let t=n.relations.filter((t,n)=>n!==e);a(`update:relations`,t)}return(t,n)=>(_(),i(`div`,Ge,[!e.relationOptions||e.relationOptions.length===0?(_(),i(`p`,Ke,` This resource type has no defined relations. `)):(_(),i(p,{key:1},[d(`div`,qe,[(_(!0),i(p,null,y(u.value,(e,t)=>(_(),i(`div`,{key:`${e.verb}:${e.kind}:${e.name}`,class:`relation-item`},[d(`span`,Je,[d(`strong`,null,S(e.verb),1),s(` → `+S(e.kind)+`: `,1),d(`em`,null,S(e.name),1)]),d(`button`,{class:`btn-remove`,type:`button`,title:`Remove`,onClick:e=>g(t)},[...n[2]||=[d(`i`,{class:`iconoir-xmark`},null,-1)]],8,Ye)]))),128))]),d(`div`,Xe,[oe(d(`select`,{"onUpdate:modelValue":n[0]||=e=>o.value=e},[n[3]||=d(`option`,{value:``},`Select relation...`,-1),(_(!0),i(p,null,y(e.relationOptions,e=>(_(),i(`option`,{key:e.combo,value:e.combo},S(e.verb)+` → `+S(e.target_kind),9,Ze))),128))],512),[[r,o.value]]),oe(d(`select`,{"onUpdate:modelValue":n[1]||=e=>l.value=e},[n[4]||=d(`option`,{value:``},`Select instance...`,-1),(_(!0),i(p,null,y(m.value,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Qe))),128))],512),[[r,l.value]]),d(`button`,{class:`secondary btn-add`,type:`button`,onClick:h},[...n[5]||=[d(`i`,{class:`iconoir-plus`},null,-1),s(` Add `,-1)]])])],64))]))}},[[`__scopeId`,`data-v-a987a6fe`]]),et={class:`yaml-output-container`},tt={key:0,class:`conflict-error`},nt={class:`yaml-success`},rt={id:`yaml-content`},it={key:0,class:`yaml-file-info`},at={key:1,class:`yaml-instructions`},ot={class:`yaml-actions`},st=[`disabled`],ct=b({__name:`EditorYamlOutput`,props:{yaml:String,format:{type:String,default:`yaml`},kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:[`editAgain`],setup(e,{emit:t}){let n=e,r=T(null),o=T(`idle`),f=T(`idle`),m=T(null),h=c(()=>n.format===`markdown`),g=c(()=>h.value?`Markdown`:`YAML`),v=c(()=>h.value?`.md`:`.yaml`);l(()=>{r.value&&ce(r.value)}),se(()=>n.yaml,async()=>{await u(),r.value&&ce(r.value)});async function y(){try{await navigator.clipboard.writeText(n.yaml),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}catch{let e=document.createElement(`textarea`);e.value=n.yaml,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}}async function b(){f.value=`saving`,m.value=null;try{let e=await a(n.kind,n.name,n.yaml,n.contentHash);e.success?(f.value=`saved`,setTimeout(()=>{f.value=`idle`},2e3)):e.conflict?(m.value=e.error,f.value=`idle`):(alert(`Save failed: `+e.error),f.value=`idle`)}catch(e){alert(`Save failed: `+e.message),f.value=`idle`}}return(t,n)=>(_(),i(`div`,et,[m.value?(_(),i(`div`,tt,[n[1]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),d(`span`,null,S(m.value),1)])):D(``,!0),d(`p`,nt,[n[2]||=d(`i`,{class:`iconoir-check-circle`},null,-1),s(` Generated `+S(g.value),1)]),d(`div`,{ref_key:`codeEl`,ref:r},[d(`pre`,rt,[d(`code`,{class:E(`language-${e.format}`)},S(e.yaml),3)])],512),d(`footer`,null,[e.pathRef?(_(),i(`p`,it,[n[3]||=d(`i`,{class:`iconoir-folder`},null,-1),d(`span`,null,`Source: `+S(e.pathRef),1)])):(_(),i(`p`,at,[n[10]||=d(`i`,{class:`iconoir-info-circle`},null,-1),d(`span`,null,[s(` Copy this `+S(g.value)+` and save it to a `,1),d(`code`,null,S(v.value),1),n[6]||=s(` file in your resources directory`,-1),h.value?(_(),i(p,{key:0},[n[4]||=s(` (named `,-1),d(`code`,null,S(e.name)+`.md`,1),n[5]||=s(`)`,-1)],64)):D(``,!0),n[7]||=s(`, `,-1),n[8]||=d(`br`,null,null,-1),n[9]||=s(`then reload the application. `,-1)])])),d(`div`,ot,[e.pathRef&&e.inlineEditEnabled?(_(),i(`button`,{key:0,type:`button`,onClick:b,disabled:f.value===`saving`,class:E({saved:f.value===`saved`})},[d(`i`,{class:E(f.value===`saving`?`iconoir-refresh`:f.value===`saved`?`iconoir-check`:`iconoir-check-circle`)},null,2),s(` `+S(f.value===`saving`?`Saving...`:f.value===`saved`?`Saved!`:`Save to File`),1)],10,st)):D(``,!0),d(`button`,{type:`button`,onClick:y,class:E({copied:o.value===`copied`})},[d(`i`,{class:E(o.value===`copied`?`iconoir-check`:`iconoir-copy`)},null,2),s(` `+S(o.value===`copied`?`Copied!`:`Copy to Clipboard`),1)],2),d(`button`,{class:`secondary`,type:`button`,onClick:n[0]||=e=>t.$emit(`editAgain`)},[...n[11]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit Again `,-1)]])])])]))}},[[`__scopeId`,`data-v-b5ea938f`]]);function O(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ut=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,dt=ut&&`documentMode`in document?document.documentMode:null,ft=ut&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pt=ut&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),mt=!(!ut||!(`InputEvent`in window)||dt)&&`getTargetRanges`in new window.InputEvent(`input`),ht=ut&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gt=ut&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_t=ut&&/Android/.test(navigator.userAgent),vt=ut&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yt=ut&&_t&&vt,bt=ut&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ft&&!vt,xt=0,St=1,Ct=2,wt=1,Tt=2,Et=3,Dt=4,Ot=5,kt=6,At=ht||gt||bt?`\xA0`:``,jt=`
|
|
2
2
|
|
|
3
3
|
`,Mt=pt?`\xA0`:At,Nt=`֑-߿יִ-﷽ﹰ-ﻼ`,Pt=`A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--`,Ft=RegExp(`^[^`+Pt+`]*[`+Nt+`]`),It=RegExp(`^[^`+Nt+`]*[`+Pt+`]`),Lt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Rt={directionless:1,unmergeable:2},zt={center:2,end:6,justify:4,left:1,right:3,start:5},Bt={[Tt]:`center`,[kt]:`end`,[Dt]:`justify`,[wt]:`left`,[Et]:`right`,[Ot]:`start`},Vt={normal:0,segmented:2,token:1},Ht={[xt]:`normal`,[Ct]:`segmented`,[St]:`token`},Ut=`$config`;function Wt(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(B(o)&&Wt(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Gt=!1,Kt=0;function qt(e){Kt=e.timeStamp}function Jt(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Xo(e,n)!==void 0}function Yt(e,t,n){let r=Ls(ks(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&cs(t,o,i,a,!1)}function Xt(e,t,n){if(P(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return zo(t)&&n.isAttached()}function Zt(e,t,n,r){for(let i=e;i&&!Qs(i);i=Cs(i)){let e=Xo(i,t);if(e!==void 0){let t=W(e,n);if(t)return V(t)||!J(i)?void 0:[i,t]}else if(i===r)return[r,es(n)]}}function Qt(e,t,n){Gt=!0;let r=performance.now()-Kt>100;try{io(e,()=>{let i=F()||function(e){return e.getEditorState().read(()=>{let e=F();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Zt(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&N(g)&&zo(p)&&Xt(i,p,g)&&Yt(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=Yo(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Jt(r,a,e)){if(pt){let e=(J(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Jt(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Jt(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&ts(i),pt&&xs(e)&&i.insertRawText(u))})}finally{Gt=!1}}function $t(e){let t=e._observer;t!==null&&Qt(e,t.takeRecords(),t)}function en(e){(function(e){Kt===0&&ks(e).addEventListener(`textInput`,qt,!0)})(e),e._observer=new MutationObserver((t,n)=>{Qt(e,t,n)})}var tn=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||dn).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function nn(e,t){return new tn(e,t)}function rn(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function an(e,t,n){let r;if(R(),typeof n==`function`){let i=e.getLatest(),a=rn(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return cn(i).updateFromKnown(t,r),i}function on(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=ec(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var sn=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return un(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=un(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function cn(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new sn(t,ln(t));return t.__state=n,n}function ln(e){return e.__state?e.__state.sharedNodeState:Do(Gs(),e.getType()).sharedNodeState}function un(e){if(e)for(let t in e)return e}function dn(e){return e}function fn(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function pn(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function mn(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function hn(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&fn(n,e,t)||t&&fn(n,t,e)||e&&pn(n,e,t)||t&&pn(n,t,e))}(c,l))}function gn(e,t){let n=e.mergeWithSibling(t),r=z()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function _n(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&N(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(hn(t,r)){r=gn(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&N(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(hn(r,n)){r=gn(r,n);break}break}n.remove()}}else r.remove()}function vn(e){return yn(e.anchor),yn(e.focus),e}function yn(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),N(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!B(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,k=``,An=null,jn=null,Mn=!1,Nn=!1;function Pn(e,t){let n=En.get(e);if(t!==null){let n=Qn(e);n.parentNode===t&&t.removeChild(n)}if(Dn.has(e)||xn._keyToDOMMap.delete(e),B(n)){let e=Kn(n,En);Fn(e,0,e.length-1,null)}n!==void 0&&vs(kn,Sn,Cn,n,`destroyed`)}function Fn(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Pn(t,r)}}function In(e,t){e.setProperty(`text-align`,t)}var Ln=`40px`;function Rn(e,t){let n=bn.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(xn._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||Ln;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function zn(e,t){let n=e.style;t===0?In(n,``):t===1?In(n,`left`):t===2?In(n,`center`):t===3?In(n,`right`):t===4?In(n,`justify`):t===5?In(n,`start`):t===6&&In(n,`end`)}function Bn(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(H(e))return null;let n=e.getParentOrThrow();return H(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Vn(e,t){let n=Dn.get(e);n===void 0&&O(60);let r=n.createDOM(bn,xn);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,xn),N(n)?r.setAttribute(`data-lexical-text`,`true`):V(n)&&r.setAttribute(`data-lexical-decorator`,`true`),B(n)){let e=n.__indent,t=n.__size;if(Bn(r,n),e!==0&&Rn(r,e),t!==0){let e=t-1;Hn(Kn(n,Dn),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&zn(r,i),n.isInline()||Wn(null,n,r)}else{let t=n.getTextContent();if(V(n)){let t=n.decorate(xn,bn);t!==null&&Jn(e,t),r.contentEditable=`false`}k+=t}return t!==null&&t.insertChild(r),vs(kn,Sn,Cn,n,`created`),r}function Hn(e,t,n,r,i){let a=k;k=``;let o=n;for(;o<=r;++o){Vn(e[o],i);let t=Dn.get(e[o]);t!==null&&N(t)?An===null&&(An=t.getFormat(),jn=t.getStyle()):B(t)&&o<r&&!t.isInline()&&(k+=jt)}i.element.__lexicalTextContent=k,k=a+k}function Un(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return j(e)?`line-break`:V(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Wn(e,t,n){let r=Un(e,En),i=Un(t,Dn);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Gn(e,t,n){var r;An=null,jn=null,function(e,t,n){let r=k,i=e.__size,a=t.__size;k=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)qn(n,o);else{let e=Qn(n),t=Vn(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Pn(n,null)}let i=Dn.get(r);N(i)&&An===null&&(An=i.getFormat(),jn=i.getStyle())}else{let r=Kn(e,En),s=Kn(t,Dn);if(r.length!==i&&O(227),s.length!==a&&O(228),i===0)a!==0&&Hn(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;Fn(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Yn(qn(r,a.element)),d++,f++;else{if(l===void 0&&(l=Xn(n,f)),c===void 0)c=Xn(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Yn(Qn(e)),Pn(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=Ss(xn,r);e!==u&&a.withBefore(u).insertChild(e),u=Yn(qn(r,a.element)),d++,f++}else Vn(r,a.withBefore(u)),f++}let i=Dn.get(r);i!==null&&N(i)?An===null&&(An=i.getFormat(),jn=i.getStyle()):B(i)&&f<=s&&!i.isInline()&&(k+=jt)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:xn.getElementByKey(e);Hn(n,0,f,s,a.withBefore(t))}else m&&!p&&Fn(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=k,k=r+k}(e,t,t.getDOMSlot(n)),r=t,An==null||An===r.__textFormat||Nn||r.setTextFormat(An),function(e){jn==null||jn===e.__textStyle||Nn||e.setTextStyle(jn)}(t)}function Kn(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&O(101),n.push(r),r=e.__next}return n}function qn(e,t){let n=En.get(e),r=Dn.get(e);n!==void 0&&r!==void 0||O(61);let i=Mn||Tn.has(e)||wn.has(e),a=Ss(xn,e);if(n===r&&!i){let e;if(B(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return k+=e,a}if(n!==r&&i&&vs(kn,Sn,Cn,r,`updated`),r.updateDOM(n,a,bn)){let n=Vn(e,null);return t===null&&O(62),t.replaceChild(n,a),Pn(e,null),n}if(B(n)){B(r)||O(334,e);let t=r.__indent;(Mn||t!==n.__indent)&&Rn(a,t);let o=r.__format;if((Mn||o!==n.__format)&&zn(a,o),i)Gn(n,r,a),H(r)||r.isInline()||Wn(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),k+=t}if((Mn||r.__dir!==n.__dir)&&(Bn(a,r),H(r)&&!Mn))for(let e of r.getChildren())B(e)&&Bn(Ss(xn,e.getKey()),e)}else{let t=r.getTextContent();if(V(r)){let t=r.decorate(xn,bn);t!==null&&Jn(e,t)}k+=t}if(!Nn&&H(r)&&r.__cachedText!==k){let e=r.getWritable();e.__cachedText=k,r=e}return a}function Jn(e,t){let n=xn._pendingDecorators,r=xn._decorators;if(n===null){if(r[e]===t)return;n=Qo(xn)}n[e]=t}function Yn(e){let t=e.nextSibling;return t!==null&&t===xn._blockCursorElement&&(t=t.nextSibling),t}function Xn(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function Zn(e,t,n,r,i,a){k=``,Mn=r===2,xn=n,bn=n._config,Sn=n._nodes,Cn=xn._listeners.mutation,wn=i,Tn=a,En=e._nodeMap,Dn=t._nodeMap,Nn=t._readOnly,On=new Map(n._keyToDOMMap);let o=new Map;return kn=o,qn(`root`,null),xn=void 0,Sn=void 0,wn=void 0,Tn=void 0,En=void 0,Dn=void 0,bn=void 0,On=void 0,kn=void 0,o}function Qn(e){let t=On.get(e);return t===void 0&&O(75,e),t}function A(e){return{type:e}}var $n=A(`SELECTION_CHANGE_COMMAND`),er=A(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),tr=A(`CLICK_COMMAND`),nr=A(`BEFORE_INPUT_COMMAND`),rr=A(`INPUT_COMMAND`),ir=A(`COMPOSITION_START_COMMAND`),ar=A(`COMPOSITION_END_COMMAND`),or=A(`DELETE_CHARACTER_COMMAND`),sr=A(`INSERT_LINE_BREAK_COMMAND`),cr=A(`INSERT_PARAGRAPH_COMMAND`),lr=A(`CONTROLLED_TEXT_INSERTION_COMMAND`),ur=A(`PASTE_COMMAND`),dr=A(`REMOVE_TEXT_COMMAND`),fr=A(`DELETE_WORD_COMMAND`),pr=A(`DELETE_LINE_COMMAND`),mr=A(`FORMAT_TEXT_COMMAND`),hr=A(`UNDO_COMMAND`),gr=A(`REDO_COMMAND`),_r=A(`KEYDOWN_COMMAND`),vr=A(`KEY_ARROW_RIGHT_COMMAND`),yr=A(`MOVE_TO_END`),br=A(`KEY_ARROW_LEFT_COMMAND`),xr=A(`MOVE_TO_START`),Sr=A(`KEY_ARROW_UP_COMMAND`),Cr=A(`KEY_ARROW_DOWN_COMMAND`),wr=A(`KEY_ENTER_COMMAND`),Tr=A(`KEY_SPACE_COMMAND`),Er=A(`KEY_BACKSPACE_COMMAND`),Dr=A(`KEY_ESCAPE_COMMAND`),Or=A(`KEY_DELETE_COMMAND`),kr=A(`KEY_TAB_COMMAND`),Ar=A(`INSERT_TAB_COMMAND`),jr=A(`INDENT_CONTENT_COMMAND`),Mr=A(`OUTDENT_CONTENT_COMMAND`),Nr=A(`DROP_COMMAND`),Pr=A(`FORMAT_ELEMENT_COMMAND`),Fr=A(`DRAGSTART_COMMAND`),Ir=A(`DRAGOVER_COMMAND`),Lr=A(`DRAGEND_COMMAND`),Rr=A(`COPY_COMMAND`),zr=A(`CUT_COMMAND`),Br=A(`SELECT_ALL_COMMAND`),Vr=A(`CLEAR_EDITOR_COMMAND`),Hr=A(`CLEAR_HISTORY_COMMAND`),Ur=A(`CAN_REDO_COMMAND`),Wr=A(`CAN_UNDO_COMMAND`),Gr=A(`FOCUS_COMMAND`),Kr=A(`BLUR_COMMAND`),qr=A(`KEY_MODIFIER_COMMAND`),Jr=Object.freeze({}),Yr=[[`keydown`,function(e,t){Xr=e.timeStamp,Zr=e.key,!t.isComposing()&&q(t,_r,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;Bs(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&io(t,()=>{Ao(n)||(ri=!0)})}],[`compositionstart`,function(e,t){q(t,ir,e)}],[`compositionend`,function(e,t){pt?ai=!0:gt||!ht&&!bt?q(t,ar,e):(oi=!0,si=e.data)}],[`input`,function(e,t){e.stopPropagation(),io(t,()=>{t.dispatchCommand(rr,e)},{event:e}),$r=null}],[`click`,function(e,t){io(t,()=>{let n=F(),r=Ls(ks(t)),i=Da();if(r){if(P(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!H(a)&&G().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=nc(a,e=>B(e)&&!e.isInline());B(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(J(n)||zo(n))&&ts(Ea(i,r,t,e))}}q(t,tr,e)})}],[`cut`,Jr],[`copy`,Jr],[`dragstart`,Jr],[`dragover`,Jr],[`dragend`,Jr],[`paste`,Jr],[`focus`,Jr],[`blur`,Jr],[`drop`,Jr]];mt&&Yr.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||pt&&xs(t)||n!==`insertCompositionText`&&q(t,nr,e)}(e,t)]);var Xr=0,Zr=null,Qr=0,$r=null,ei=new WeakMap,ti=new WeakMap,ni=!1,ri=!1,ii=!1,ai=!1,oi=!1,si=``,ci=null,li=[0,``,0,`root`,0];function ui(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=z(),l=Ls(ks(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!N(s)||(!i&&(!mt||Qr<r+50)||s.isDirty()&&p<2||rs(n))&&a.offset!==o.offset&&!s.isComposing()||Ro(s)||s.isDirty()&&p>1||(i||!mt)&&f!==null&&!s.isComposing()&&u!==Vo(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=Lo(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(N(t)||B(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function di(e,t){return zo(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function fi(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;ni&&(ni=!1,di(r,i)&&di(a,o)&&!ci)||io(t,()=>{if(!n)return void ts(null);if(!Mo(t,r,a))return;let s=F();if(ci&&P(s)&&s.isCollapsed()){let e=s.anchor,t=ci.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=ci.clone(),ts(s))}if(ci=null,P(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=ks(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=li,f=G(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)pi(s,o,c);else if(n.type===`text`)N(r)||O(141),mi(s,r);else if(n.type===`element`&&!p){B(r)||O(259);let e=n.getNode();e.isEmpty()?function(e,t){pi(e,t.getTextFormat(),t.getTextStyle())}(s,e):pi(s,0,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(N(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}q(t,$n,void 0)})}function pi(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function mi(e,t){pi(e,t.getFormat(),t.getStyle())}function hi(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function gi(e){let t=e.inputType,n=hi(e),r=z(),i=F();if(t===`deleteContentBackward`){if(i===null){let e=Da();if(!P(e))return!0;ts(e.clone())}if(P(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,Zr===`MediaLast`&&a<Xr+30&&r.isComposing()&&t){if(qo(null),Xr=0,setTimeout(()=>{io(r,()=>{qo(null)})},30),P(i)){let e=i.anchor.getNode();e.markDirty(),N(e)||O(142),mi(i,e)}}else{qo(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=yt&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!V(bs(i.anchor,!0))),!c){q(r,or,!0);let e=F();yt&&P(e)&&e.isCollapsed()&&(ci=e,setTimeout(()=>ci=null))}}return!0}}var a;if(!P(i))return!0;let o=e.data;$r!==null&&ss(!1,r,$r),i.dirty&&$r===null||!i.isCollapsed()||H(i.anchor.getNode())||n===null||i.applyDOMRange(n),$r=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
|
4
4
|
`)e.preventDefault(),q(r,sr,!1);else if(o===jt)e.preventDefault(),q(r,cr,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&ui(i,n,o,e.timeStamp,!0)?(e.preventDefault(),q(r,lr,o)):$r=o;return Qr=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:q(r,lr,e);break;case`insertFromComposition`:qo(null),q(r,lr,e);break;case`insertLineBreak`:qo(null),q(r,sr,!1);break;case`insertParagraph`:qo(null),ii&&!gt?(ii=!1,q(r,sr,!1)):q(r,cr,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:q(r,ur,e);break;case`deleteByComposition`:(function(e,t){return e!==t||B(e)||B(t)||!Lo(e)||!Lo(t)})(l,u)&&q(r,dr,e);break;case`deleteByDrag`:case`deleteByCut`:q(r,dr,e);break;case`deleteContent`:q(r,or,!1);break;case`deleteWordBackward`:q(r,fr,!0);break;case`deleteWordForward`:q(r,fr,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:q(r,pr,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:q(r,pr,!1);break;case`formatStrikeThrough`:q(r,mr,`strikethrough`);break;case`formatBold`:q(r,mr,`bold`);break;case`formatItalic`:q(r,mr,`italic`);break;case`formatUnderline`:q(r,mr,`underline`);break;case`historyUndo`:q(r,hr,void 0);break;case`historyRedo`:q(r,gr,void 0)}return!0}function _i(e){if(J(e.target)&&Ao(e.target))return!0;let t=z(),n=F(),r=e.data,i=hi(e);if(r!=null&&P(n)&&ui(n,i,r,e.timeStamp,!1)){ai&&=(bi(t,r),!1);let i=n.anchor.getNode(),a=Ls(ks(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;mt&&!n.isCollapsed()&&N(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===os(a.anchorNode)||q(t,lr,r);let l=r.length;pt&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),yt&&t.isComposing()&&(Xr=0,qo(null))}else ss(!1,t,r===null?void 0:r),ai&&=(bi(t,r||void 0),!1);return function(){R(),$t(z())}(),!0}function vi(e){let t=z(),n=F();if(P(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();qo(r.key),Ts(Fi),(e.timeStamp<Xr+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||N(i)&&i.getStyle()!==n.style)&&q(t,lr,Mt)}return!0}function yi(e){return bi(z(),e.data),Ts(Ii),!0}function bi(e,t){let n=e._compositionKey;if(qo(null),n!==null&&t!=null){if(t===``){let t=W(n),r=Vo(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&N(t)){let n=Ls(ks(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),cs(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as e,B as t,H as n,I as r,L as i,N as a,O as o,P as s,U as c,X as l,Z as u,a as d,ct as f,k as p,nt as m,ot as h,w as g,z as _}from"./index-
|
|
1
|
+
import{$ as e,B as t,H as n,I as r,L as i,N as a,O as o,P as s,U as c,X as l,Z as u,a as d,ct as f,k as p,nt as m,ot as h,w as g,z as _}from"./index-JZkWwfYg.js";var v={key:0},y={class:`error-header`},b={class:`error-message`},x={class:`error-location`},S={class:`error-line-badge`},C={key:0,class:`error-code-block`},w={class:`line-number`},T={key:1},E=d({__name:`ErrorPage`,setup(d){let E=o(),D=p(),O=r(()=>{try{return E.query.data?JSON.parse(E.query.data):null}catch{return null}});async function k(){let e=await g();e.error?D.replace({name:`error`,query:{data:JSON.stringify(e.error)}}):(D.push(`/`),window.location.reload())}return(r,o)=>{let d=e(`router-link`);return O.value?(l(),t(`div`,v,[i(`header`,null,[i(`article`,y,[o[1]||=i(`h3`,null,[i(`i`,{class:`iconoir-warning-triangle`}),n(` Error `)],-1),i(`p`,b,f(O.value.error),1),i(`p`,x,[o[0]||=i(`i`,{class:`iconoir-page`},null,-1),n(` `+f(O.value.path)+` `,1),i(`span`,S,`Line `+f(O.value.line_no),1)])]),i(`a`,{href:`#`,class:`reload-btn`,onClick:a(k,[`prevent`])},[...o[2]||=[i(`i`,{class:`iconoir-refresh`},null,-1),n(` Reload `,-1)]])]),O.value.context?(l(),t(`div`,C,[i(`pre`,null,[i(`code`,null,[(l(!0),t(s,null,u(O.value.context,e=>(l(),t(`span`,{key:e.line_no,class:h(e.selected?`error-line`:`code-line`)},[i(`span`,w,f(String(e.line_no).padStart(4,` `)),1),n(f(e.content)+`
|
|
2
2
|
`,1)],2))),128))])])])):_(``,!0)])):(l(),t(`div`,T,[o[4]||=i(`p`,null,`No error data available.`,-1),c(d,{to:`/`},{default:m(()=>[...o[3]||=[n(`Back to home`,-1)]]),_:1})]))}}},[[`__scopeId`,`data-v-cb96d9d5`]]);export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,J as t,K as n,L as r,X as i,Y as a,a as o,g as s,it as c}from"./index-
|
|
1
|
+
import{B as e,J as t,K as n,L as r,X as i,Y as a,a as o,g as s,it as c}from"./index-JZkWwfYg.js";import{t as l}from"./useGraphviz-DFlxVG1U.js";import{t as u}from"./usePanZoom-RxoG4Zu7.js";var d={key:0,class:`graph-loading`,"aria-busy":`true`},f={key:1,class:`graph-container graph-expand`},p=[`innerHTML`],m=o({__name:`GraphView`,setup(o){let m=c(``),h=c(!0),g=c(null),_=null;t(async()=>{let e=await s();m.value=e?await l(e):``,h.value=!1,await n(),v()}),a(()=>{_?.destroy()});function v(){if(!g.value)return;let e=g.value.querySelector(`svg`);e&&(_=u(e,g.value))}return(t,n)=>(i(),e(`article`,null,[n[0]||=r(`header`,null,[r(`h2`,null,`Architecture Overview`)],-1),h.value?(i(),e(`p`,d,`Laying out graph...`)):(i(),e(`div`,f,[r(`div`,{id:`graphviz`,ref_key:`graphEl`,ref:g,class:`fullcanvas`,innerHTML:m.value},null,8,p)]))]))}},[[`__scopeId`,`data-v-cb6fbf12`]]);export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["vue/GraphView-
|
|
2
|
-
import{M as e}from"./mermaid-C3bOamfn.js";import{B as t,G as n,I as r,L as i,R as a,W as o,X as s,at as c}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["vue/GraphView-D84CH00D.js","vue/index-JZkWwfYg.js","vue/mermaid-C3bOamfn.js","vue/rolldown-runtime-COiEfhsA.js","vue/index-BP-NH0dn.css","vue/useGraphviz-DFlxVG1U.js","vue/usePanZoom-RxoG4Zu7.js","vue/GraphView-B_EJRCcO.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{M as e}from"./mermaid-C3bOamfn.js";import{B as t,G as n,I as r,L as i,R as a,W as o,X as s,at as c}from"./index-JZkWwfYg.js";import{n as l}from"./PageView-DzKj212I.js";var u={key:2},d={__name:`HomePage`,setup(d){let f=o(()=>e(()=>import(`./GraphView-D84CH00D.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),p=n(`pages`,null),m=n(`pageHome`,null),h=r(()=>p?.value!=null),g=r(()=>m?.value);return(e,n)=>g.value?(s(),a(l,{key:0,name:g.value.name},null,8,[`name`])):h.value?(s(),a(c(f),{key:1})):(s(),t(`article`,u,[...n[0]||=[i(`p`,null,`Loading...`,-1)]]))}};export{d as default};
|