[{"data":1,"prerenderedAt":2451},["ShallowReactive",2],{"navigation_docs":3,"-developers-frameworks-tree":613,"-developers-frameworks-tree-surround":2448},[4,39,101,378,540,562,584,606],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":38},"Start","i-lucide-rocket","\u002Fstart","1.start",[10,14,18,22,26,30,34],{"title":11,"path":12,"stem":13},"Our approach","\u002Fstart\u002Four-approach","1.start\u002F0.our-approach",{"title":15,"path":16,"stem":17},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fstart\u002Fconcepts","1.start\u002F2.concepts",{"title":23,"path":24,"stem":25},"Glossary","\u002Fstart\u002Fglossary","1.start\u002F3.glossary",{"title":27,"path":28,"stem":29},"Try it locally","\u002Fstart\u002Ftry-it-locally","1.start\u002F4.try-it-locally",{"title":31,"path":32,"stem":33},"Features","\u002Fstart\u002Ffeatures","1.start\u002F5.features",{"title":35,"path":36,"stem":37},"Questions","\u002Fstart\u002Ffaq","1.start\u002F6.faq",false,{"title":40,"icon":41,"path":42,"stem":43,"children":44,"page":38},"Run SHADE","i-lucide-server","\u002Frun","2.run",[45,49,53,57,61,65,69,73,77,81,85,89,93,97],{"title":46,"path":47,"stem":48},"Setting up an instance (Coolify)","\u002Frun\u002Fcoolify","2.run\u002F1.coolify",{"title":50,"path":51,"stem":52},"Console commands","\u002Frun\u002Fconsole","2.run\u002F10.console",{"title":54,"path":55,"stem":56},"Rotating APP_SECRET","\u002Frun\u002Frotating-app-secret","2.run\u002F11.rotating-app-secret",{"title":58,"path":59,"stem":60},"Checking an instance","\u002Frun\u002Fdoctor","2.run\u002F12.doctor",{"title":62,"path":63,"stem":64},"Self-hosting by hand","\u002Frun\u002Fown-server-by-hand","2.run\u002F13.own-server-by-hand",{"title":66,"path":67,"stem":68},"NixOS (experimental)","\u002Frun\u002Fnixos","2.run\u002F14.nixos",{"title":70,"path":71,"stem":72},"Self-hosting without Coolify","\u002Frun\u002Fown-server","2.run\u002F2.own-server",{"title":74,"path":75,"stem":76},"Hosting the site on a static host","\u002Frun\u002Fstatic-hosts","2.run\u002F3.static-hosts",{"title":78,"path":79,"stem":80},"Licence","\u002Frun\u002Flicence","2.run\u002F4.licence",{"title":82,"path":83,"stem":84},"Updating and backups","\u002Frun\u002Fupdating-and-backups","2.run\u002F5.updating-and-backups",{"title":86,"path":87,"stem":88},"Troubleshooting","\u002Frun\u002Ftroubleshooting","2.run\u002F6.troubleshooting",{"title":90,"path":91,"stem":92},"Logs, request ids, traces and metrics","\u002Frun\u002Flogs","2.run\u002F7.logs",{"title":94,"path":95,"stem":96},"Maintenance mode","\u002Frun\u002Fmaintenance-mode","2.run\u002F8.maintenance-mode",{"title":98,"path":99,"stem":100},"Usage limits","\u002Frun\u002Fusage-limits","2.run\u002F9.usage-limits",{"title":102,"icon":103,"path":104,"stem":105,"children":106},"Guide","i-lucide-book-open","\u002Fguide","3.guide",[107,109,147,192,210,280,310,364],{"title":102,"path":104,"stem":108},"3.guide\u002Findex",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":38},"Content","i-lucide-file-text","\u002Fguide\u002Fcontent","3.guide\u002F1.content",[115,119,123,127,131,135,139,143],{"title":116,"path":117,"stem":118},"Collections and entries","\u002Fguide\u002Fcontent\u002Fcollections","3.guide\u002F1.content\u002F1.collections",{"title":120,"path":121,"stem":122},"Field types","\u002Fguide\u002Fcontent\u002Ffields","3.guide\u002F1.content\u002F2.fields",{"title":124,"path":125,"stem":126},"Drafts, publishing and version history","\u002Fguide\u002Fcontent\u002Fversions","3.guide\u002F1.content\u002F3.versions",{"title":128,"path":129,"stem":130},"Languages","\u002Fguide\u002Fcontent\u002Flanguages","3.guide\u002F1.content\u002F4.languages",{"title":132,"path":133,"stem":134},"Data sources","\u002Fguide\u002Fcontent\u002Fdata-sources","3.guide\u002F1.content\u002F5.data-sources",{"title":136,"path":137,"stem":138},"Media","\u002Fguide\u002Fcontent\u002Fmedia","3.guide\u002F1.content\u002F6.media",{"title":140,"path":141,"stem":142},"Search","\u002Fguide\u002Fcontent\u002Fsearch","3.guide\u002F1.content\u002F7.search",{"title":144,"path":145,"stem":146},"Trash","\u002Fguide\u002Fcontent\u002Ftrash","3.guide\u002F1.content\u002F8.trash",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":38},"Website","i-lucide-globe","\u002Fguide\u002Fwebsite","3.guide\u002F2.website",[153,156,160,164,168,172,176,180,184,188],{"title":148,"path":154,"stem":155},"\u002Fguide\u002Fwebsite\u002Fwebsite","3.guide\u002F2.website\u002F1.website",{"title":157,"path":158,"stem":159},"Scroll scenes","\u002Fguide\u002Fwebsite\u002Fscroll-scenes","3.guide\u002F2.website\u002F10.scroll-scenes",{"title":161,"path":162,"stem":163},"Pages and posts","\u002Fguide\u002Fwebsite\u002Fpages","3.guide\u002F2.website\u002F2.pages",{"title":165,"path":166,"stem":167},"The visual editor","\u002Fguide\u002Fwebsite\u002Fvisual-editor","3.guide\u002F2.website\u002F3.visual-editor",{"title":169,"path":170,"stem":171},"Roles and locks","\u002Fguide\u002Fwebsite\u002Froles-and-locks","3.guide\u002F2.website\u002F4.roles-and-locks",{"title":173,"path":174,"stem":175},"Header and footer","\u002Fguide\u002Fwebsite\u002Fheader-and-footer","3.guide\u002F2.website\u002F5.header-and-footer",{"title":177,"path":178,"stem":179},"Theme","\u002Fguide\u002Fwebsite\u002Ftheme","3.guide\u002F2.website\u002F6.theme",{"title":181,"path":182,"stem":183},"Redirects","\u002Fguide\u002Fwebsite\u002Fredirects","3.guide\u002F2.website\u002F7.redirects",{"title":185,"path":186,"stem":187},"Site settings","\u002Fguide\u002Fwebsite\u002Fsite-settings","3.guide\u002F2.website\u002F8.site-settings",{"title":189,"path":190,"stem":191},"The site","\u002Fguide\u002Fwebsite\u002Fthe-site","3.guide\u002F2.website\u002F9.the-site",{"title":193,"icon":194,"path":195,"stem":196,"children":197,"page":38},"Publishing","i-lucide-send","\u002Fguide\u002Fpublishing","3.guide\u002F3.publishing",[198,202,206],{"title":199,"path":200,"stem":201},"Publishing and preview","\u002Fguide\u002Fpublishing\u002Fpublishing","3.guide\u002F3.publishing\u002F1.publishing",{"title":203,"path":204,"stem":205},"Builds","\u002Fguide\u002Fpublishing\u002Fbuilds","3.guide\u002F3.publishing\u002F2.builds",{"title":207,"path":208,"stem":209},"CDN caches","\u002Fguide\u002Fpublishing\u002Fcaches","3.guide\u002F3.publishing\u002F3.caches",{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":38},"People, security and privacy","i-lucide-shield","\u002Fguide\u002Fpeople-and-security","3.guide\u002F4.people-and-security",[216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276],{"title":217,"path":218,"stem":219},"People in SHADE","\u002Fguide\u002Fpeople-and-security\u002Fpeople-in-shade","3.guide\u002F4.people-and-security\u002F0.people-in-shade",{"title":221,"path":222,"stem":223},"Team and roles","\u002Fguide\u002Fpeople-and-security\u002Fteam","3.guide\u002F4.people-and-security\u002F1.team",{"title":225,"path":226,"stem":227},"Errors and security alerts","\u002Fguide\u002Fpeople-and-security\u002Ferrors","3.guide\u002F4.people-and-security\u002F10.errors",{"title":229,"path":230,"stem":231},"Exporting an instance","\u002Fguide\u002Fpeople-and-security\u002Fexporting","3.guide\u002F4.people-and-security\u002F11.exporting",{"title":233,"path":234,"stem":235},"Organisations","\u002Fguide\u002Fpeople-and-security\u002Forganisations","3.guide\u002F4.people-and-security\u002F12.organisations",{"title":237,"path":238,"stem":239},"Signing in through an identity provider (team)","\u002Fguide\u002Fpeople-and-security\u002Fidentity-providers","3.guide\u002F4.people-and-security\u002F13.identity-providers",{"title":241,"path":242,"stem":243},"System status","\u002Fguide\u002Fpeople-and-security\u002Fsystem-status","3.guide\u002F4.people-and-security\u002F14.system-status",{"title":245,"path":246,"stem":247},"Appearance","\u002Fguide\u002Fpeople-and-security\u002Fappearance","3.guide\u002F4.people-and-security\u002F15.appearance",{"title":249,"path":250,"stem":251},"Accounts and personal pages","\u002Fguide\u002Fpeople-and-security\u002Faccounts","3.guide\u002F4.people-and-security\u002F2.accounts",{"title":253,"path":254,"stem":255},"Signing in (team)","\u002Fguide\u002Fpeople-and-security\u002Fsign-in","3.guide\u002F4.people-and-security\u002F3.sign-in",{"title":257,"path":258,"stem":259},"API tokens","\u002Fguide\u002Fpeople-and-security\u002Fapi-tokens","3.guide\u002F4.people-and-security\u002F4.api-tokens",{"title":261,"path":262,"stem":263},"Audit log","\u002Fguide\u002Fpeople-and-security\u002Faudit","3.guide\u002F4.people-and-security\u002F5.audit",{"title":265,"path":266,"stem":267},"Request protection","\u002Fguide\u002Fpeople-and-security\u002Fprotection","3.guide\u002F4.people-and-security\u002F6.protection",{"title":269,"path":270,"stem":271},"Personal data per person","\u002Fguide\u002Fpeople-and-security\u002Fprivacy","3.guide\u002F4.people-and-security\u002F7.privacy",{"title":273,"path":274,"stem":275},"Data retention","\u002Fguide\u002Fpeople-and-security\u002Fretention","3.guide\u002F4.people-and-security\u002F8.retention",{"title":277,"path":278,"stem":279},"Consent banner","\u002Fguide\u002Fpeople-and-security\u002Fconsent","3.guide\u002F4.people-and-security\u002F9.consent",{"title":281,"icon":282,"path":283,"stem":284,"children":285,"page":38},"Services","i-lucide-plug","\u002Fguide\u002Fservices","3.guide\u002F5.services",[286,290,294,298,302,306],{"title":287,"path":288,"stem":289},"Email","\u002Fguide\u002Fservices\u002Femail","3.guide\u002F5.services\u002F1.email",{"title":291,"path":292,"stem":293},"Opening hours","\u002Fguide\u002Fservices\u002Fopening-hours","3.guide\u002F5.services\u002F4.opening-hours",{"title":295,"path":296,"stem":297},"Webhooks","\u002Fguide\u002Fservices\u002Fwebhooks","3.guide\u002F5.services\u002F5.webhooks",{"title":299,"path":300,"stem":301},"Locations","\u002Fguide\u002Fservices\u002Flocations","3.guide\u002F5.services\u002F6.locations",{"title":303,"path":304,"stem":305},"VAT rates","\u002Fguide\u002Fservices\u002Fvat-rates","3.guide\u002F5.services\u002F7.vat-rates",{"title":307,"path":308,"stem":309},"Channels","\u002Fguide\u002Fservices\u002Fchannels","3.guide\u002F5.services\u002F8.channels",{"title":311,"icon":312,"path":313,"stem":314,"children":315,"page":38},"InstalledModules","i-lucide-puzzle","\u002Fguide\u002Fmodules","3.guide\u002F6.modules",[316,320,324,328,332,336,340,344,348,352,356,360],{"title":317,"path":318,"stem":319},"Modules","\u002Fguide\u002Fmodules\u002Fmanaging","3.guide\u002F6.modules\u002F1.managing",{"title":321,"path":322,"stem":323},"Dutch services (module)","\u002Fguide\u002Fmodules\u002Fnl","3.guide\u002F6.modules\u002F10.nl",{"title":325,"path":326,"stem":327},"Editorial (module)","\u002Fguide\u002Fmodules\u002Feditorial","3.guide\u002F6.modules\u002F11.editorial",{"title":329,"path":330,"stem":331},"Appointments (module)","\u002Fguide\u002Fmodules\u002Fappointments","3.guide\u002F6.modules\u002F2.appointments",{"title":333,"path":334,"stem":335},"Shop (the commerce module)","\u002Fguide\u002Fmodules\u002Fshop","3.guide\u002F6.modules\u002F3.shop",{"title":337,"path":338,"stem":339},"Untrusted modules","\u002Fguide\u002Fmodules\u002Funtrusted","3.guide\u002F6.modules\u002F4.untrusted",{"title":341,"path":342,"stem":343},"Analytics (module)","\u002Fguide\u002Fmodules\u002Fanalytics","3.guide\u002F6.modules\u002F5.analytics",{"title":345,"path":346,"stem":347},"Error forwarding (module)","\u002Fguide\u002Fmodules\u002Ferror-forwarding","3.guide\u002F6.modules\u002F6.error-forwarding",{"title":349,"path":350,"stem":351},"Client programs","\u002Fguide\u002Fmodules\u002Fprograms","3.guide\u002F6.modules\u002F7.programs",{"title":353,"path":354,"stem":355},"Import and export (module)","\u002Fguide\u002Fmodules\u002Fimport","3.guide\u002F6.modules\u002F8.import",{"title":357,"path":358,"stem":359},"Payments (module)","\u002Fguide\u002Fmodules\u002Fpayments","3.guide\u002F6.modules\u002F8.payments",{"title":361,"path":362,"stem":363},"Forms (module)","\u002Fguide\u002Fmodules\u002Fforms","3.guide\u002F6.modules\u002F9.forms",{"title":365,"icon":366,"path":367,"stem":368,"children":369,"page":38},"AI assistants","i-lucide-bot","\u002Fguide\u002Fai","3.guide\u002F7.ai",[370,374],{"title":371,"path":372,"stem":373},"AI assistants (MCP)","\u002Fguide\u002Fai\u002Fassistants","3.guide\u002F7.ai\u002F1.assistants",{"title":375,"path":376,"stem":377},"Connecting an AI assistant","\u002Fguide\u002Fai\u002Fconnecting","3.guide\u002F7.ai\u002F2.connecting",{"title":379,"icon":380,"path":381,"stem":382,"children":383,"page":38},"Developers","i-lucide-code","\u002Fdevelopers","4.developers",[384,388,392,396,400,404,408,412,416,420,424,428,432,435,489,493,497,501,536],{"title":385,"path":386,"stem":387},"Architecture","\u002Fdevelopers\u002Farchitecture","4.developers\u002F1.architecture",{"title":389,"path":390,"stem":391},"Capabilities","\u002Fdevelopers\u002Fcapabilities","4.developers\u002F10.capabilities",{"title":393,"path":394,"stem":395},"Trust","\u002Fdevelopers\u002Ftrust","4.developers\u002F11.trust",{"title":397,"path":398,"stem":399},"Redis and the ports","\u002Fdevelopers\u002Fredis","4.developers\u002F12.redis",{"title":401,"path":402,"stem":403},"The worker container role","\u002Fdevelopers\u002Fworker","4.developers\u002F13.worker",{"title":405,"path":406,"stem":407},"kv: a module's own key-value storage","\u002Fdevelopers\u002Fkv","4.developers\u002F14.kv",{"title":409,"path":410,"stem":411},"Processes: long-running work on the worker","\u002Fdevelopers\u002Fprocesses","4.developers\u002F15.processes",{"title":413,"path":414,"stem":415},"Network: a module's outgoing calls","\u002Fdevelopers\u002Fnetwork","4.developers\u002F16.network",{"title":417,"path":418,"stem":419},"Realtime","\u002Fdevelopers\u002Frealtime","4.developers\u002F17.realtime",{"title":421,"path":422,"stem":423},"Private files","\u002Fdevelopers\u002Ffiles","4.developers\u002F18.files",{"title":425,"path":426,"stem":427},"Notify","\u002Fdevelopers\u002Fnotify","4.developers\u002F19.notify",{"title":429,"path":430,"stem":431},"Collections","\u002Fdevelopers\u002Fcollections","4.developers\u002F2.collections",{"title":337,"path":433,"stem":434},"\u002Fdevelopers\u002Funtrusted","4.developers\u002F20.untrusted",{"title":436,"icon":312,"path":437,"stem":438,"children":439},"Writing a plugin","\u002Fdevelopers\u002Fmodules","4.developers\u002F3.modules\u002Findex",[440,442,446,450,454,458,462,466,470,473,477,481,485],{"title":441,"path":437,"stem":438},"Writing a module",{"title":443,"path":444,"stem":445},"Module SDK and tooling","\u002Fdevelopers\u002Fmodules\u002Fsdk-and-tooling","4.developers\u002F3.modules\u002F1.sdk-and-tooling",{"title":447,"path":448,"stem":449},"Connecting accounts with OAuth2","\u002Fdevelopers\u002Fmodules\u002Foauth","4.developers\u002F3.modules\u002F10.oauth",{"title":451,"path":452,"stem":453},"Calls between modules","\u002Fdevelopers\u002Fmodules\u002Fcalls-between-modules","4.developers\u002F3.modules\u002F11.calls-between-modules",{"title":455,"path":456,"stem":457},"Experimental parts","\u002Fdevelopers\u002Fmodules\u002Fexperimental-parts","4.developers\u002F3.modules\u002F12.experimental-parts",{"title":459,"path":460,"stem":461},"The manifest","\u002Fdevelopers\u002Fmodules\u002Fmanifest","4.developers\u002F3.modules\u002F2.manifest",{"title":463,"path":464,"stem":465},"Routes","\u002Fdevelopers\u002Fmodules\u002Froutes","4.developers\u002F3.modules\u002F3.routes",{"title":467,"path":468,"stem":469},"Admin screens and the site part","\u002Fdevelopers\u002Fmodules\u002Fadmin-and-site","4.developers\u002F3.modules\u002F4.admin-and-site",{"title":110,"path":471,"stem":472},"\u002Fdevelopers\u002Fmodules\u002Fcontent","4.developers\u002F3.modules\u002F5.content",{"title":474,"path":475,"stem":476},"Background work and services","\u002Fdevelopers\u002Fmodules\u002Fbackground-and-services","4.developers\u002F3.modules\u002F6.background-and-services",{"title":478,"path":479,"stem":480},"SDK reference","\u002Fdevelopers\u002Fmodules\u002Fsdk-reference","4.developers\u002F3.modules\u002F7.sdk-reference",{"title":482,"path":483,"stem":484},"The website module's SDK","\u002Fdevelopers\u002Fmodules\u002Fwebsite-sdk","4.developers\u002F3.modules\u002F8.website-sdk",{"title":486,"path":487,"stem":488},"Incoming webhooks","\u002Fdevelopers\u002Fmodules\u002Fincoming-webhooks","4.developers\u002F3.modules\u002F9.incoming-webhooks",{"title":490,"path":491,"stem":492},"Core and the website module","\u002Fdevelopers\u002Fcore-and-website-module","4.developers\u002F4.core-and-website-module",{"title":494,"path":495,"stem":496},"The API","\u002Fdevelopers\u002Fapi","4.developers\u002F6.api",{"title":498,"path":499,"stem":500},"API reference","\u002Fdevelopers\u002Fapi-reference","4.developers\u002F6.api-reference",{"title":502,"icon":503,"path":504,"stem":505,"children":506},"Sites in other frameworks","i-lucide-layout-template","\u002Fdevelopers\u002Fframeworks","4.developers\u002F7.frameworks\u002Findex",[507,508,512,516,520,524,528,532],{"title":502,"path":504,"stem":505},{"title":509,"path":510,"stem":511},"Accounts: sign-in and modules' routes","\u002Fdevelopers\u002Fframeworks\u002Faccounts","4.developers\u002F7.frameworks\u002F1.accounts",{"title":513,"path":514,"stem":515},"`@shadestack\u002Ftree`","\u002Fdevelopers\u002Fframeworks\u002Ftree","4.developers\u002F7.frameworks\u002F2.tree",{"title":517,"path":518,"stem":519},"Expressions and styles","\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles","4.developers\u002F7.frameworks\u002F3.expressions-and-styles",{"title":521,"path":522,"stem":523},"`@shadestack\u002Frender`","\u002Fdevelopers\u002Fframeworks\u002Frender","4.developers\u002F7.frameworks\u002F4.render",{"title":525,"path":526,"stem":527},"`@shadestack\u002Finteractions`","\u002Fdevelopers\u002Fframeworks\u002Finteractions","4.developers\u002F7.frameworks\u002F5.interactions",{"title":529,"path":530,"stem":531},"`@shadestack\u002Fa11y`","\u002Fdevelopers\u002Fframeworks\u002Fa11y","4.developers\u002F7.frameworks\u002F6.a11y",{"title":533,"path":534,"stem":535},"Your own page for SHADE's links","\u002Fdevelopers\u002Fframeworks\u002Flinks","4.developers\u002F7.frameworks\u002F7.links",{"title":537,"path":538,"stem":539},"Build a client module","\u002Fdevelopers\u002Fclient-module","4.developers\u002F9.client-module",{"title":541,"icon":542,"path":543,"stem":544,"children":545,"page":38},"Security","i-lucide-shield-check","\u002Fsecurity","5.security",[546,550,554,558],{"title":547,"path":548,"stem":549},"Reporting a vulnerability","\u002Fsecurity\u002Freporting","5.security\u002F0.reporting",{"title":551,"path":552,"stem":553},"Security testing","\u002Fsecurity\u002Ftesting","5.security\u002F1.testing",{"title":555,"path":556,"stem":557},"Hardening a production instance","\u002Fsecurity\u002Fhardening","5.security\u002F2.hardening",{"title":559,"path":560,"stem":561},"Manual testing with Kali Linux","\u002Fsecurity\u002Fmanual-testing","5.security\u002F3.manual-testing",{"title":563,"icon":564,"path":565,"stem":566,"children":567,"page":38},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","6.contributing",[568,572,576,580],{"title":569,"path":570,"stem":571},"Reading the code","\u002Fcontributing\u002Freading-the-code","6.contributing\u002F1.reading-the-code",{"title":573,"path":574,"stem":575},"Docs site","\u002Fcontributing\u002Fdocs-site","6.contributing\u002F2.docs-site",{"title":577,"path":578,"stem":579},"Releases","\u002Fcontributing\u002Freleases","6.contributing\u002F3.releases",{"title":581,"path":582,"stem":583},"Load tests","\u002Fcontributing\u002Fload-tests","6.contributing\u002F4.load-tests",{"title":585,"icon":586,"path":587,"stem":588,"children":589,"page":38},"Project","i-lucide-map","\u002Fproject","7.project",[590,594,598,602],{"title":591,"path":592,"stem":593},"Roadmap","\u002Fproject\u002Froadmap","7.project\u002F1.roadmap",{"title":595,"path":596,"stem":597},"Known issues","\u002Fproject\u002Fknown-issues","7.project\u002F2.known-issues",{"title":599,"path":600,"stem":601},"Changelog","\u002Fproject\u002Fchangelog","7.project\u002F3.changelog",{"title":603,"path":604,"stem":605},"Decisions","\u002Fproject\u002Fdecisions","7.project\u002F4.decisions",{"title":607,"path":608,"stem":609,"children":610,"icon":612},"Community","\u002Fcommunity","8.community\u002Findex",[611],{"title":607,"path":608,"stem":609},"i-lucide-users",{"id":614,"title":513,"body":615,"description":839,"extension":2443,"links":2444,"meta":2445,"navigation":904,"path":514,"seo":2446,"stem":515,"__hash__":2447},"docs\u002F4.developers\u002F7.frameworks\u002F2.tree.md",{"type":616,"value":617,"toc":2441},"minimark",[618,651,658,833,1545,2425,2438],[619,620,621,622,630,631,634,635,638,639,642,643,646,647,650],"p",{},"The website editor's page tree. Framework-free, with zod and\n",[623,624,626],"a",{"href":625},"\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles#shadestackexpressions",[627,628,629],"code",{},"@shadestack\u002Fexpressions"," as its only dependencies, and not a site\npackage itself: the expressions, styles, the rendering core and the four renderers, interactions, the accessibility\nchecker and the editor build on its types. The website module keeps a page's tree in a json field and checks it\nitself (",[627,632,633],{},"website:tree",": ",[627,636,637],{},"readTree"," with the site's languages, its component library, its embed permission, the\neditor roles and the media types each place takes), and the content API gives it to sites as ",[627,640,641],{},"page.tree",".\n",[627,644,645],{},"asNodeTree(stored)"," reads a stored value as a tree for showing it (an older version migrated, anything else an empty\ntree), and ",[627,648,649],{},"isNodeTree"," says whether a value has a tree's shape.",[619,652,653,654,657],{},"A stored tree is ",[627,655,656],{},"{ version, nodes }",". Eight node types; the first seven match what a developer writes in code:",[659,660,661,677],"table",{},[662,663,664],"thead",{},[665,666,667,671,674],"tr",{},[668,669,670],"th",{},"Node",[668,672,673],{},"Is",[668,675,676],{},"In code",[678,679,680,696,711,738,761,776,791,818],"tbody",{},[665,681,682,688,691],{},[683,684,685],"td",{},[627,686,687],{},"element",[683,689,690],{},"an allow-listed tag with allow-listed attributes, style classes and children",[683,692,693],{},[627,694,695],{},"\u003Csection class=\"…\">",[665,697,698,703,706],{},[683,699,700],{},[627,701,702],{},"text",[683,704,705],{},"plain text, per language, escaped when rendered",[683,707,708],{},[627,709,710],{},"Welcome",[665,712,713,718,733],{},[683,714,715],{},[627,716,717],{},"component",[683,719,720,721,724,725,728,729,732],{},"an instance of a component (a library's ",[627,722,723],{},"card",", a module's ",[627,726,727],{},"shop.offer",", or one of SHADE's widgets, ",[627,730,731],{},"shade:dialog","): its properties and its slots' nodes",[683,734,735],{},[627,736,737],{},"\u003CCard title=\"…\">\u003Cp>…\u003C\u002Fp>\u003C\u002FCard>",[665,739,740,745,756],{},[683,741,742],{},[627,743,744],{},"if",[683,746,747,748,751,752,755],{},"a condition with a ",[627,749,750],{},"then"," and an ",[627,753,754],{},"else"," branch",[683,757,758],{},[627,759,760],{},"{#if}…{:else}…{\u002Fif}",[665,762,763,768,771],{},[683,764,765],{},[627,766,767],{},"each",[683,769,770],{},"a loop over a list or a data source, with an item name, an optional index name and a key",[683,772,773],{},[627,774,775],{},"{#each items as product (product.id)}",[665,777,778,783,786],{},[683,779,780],{},[627,781,782],{},"slot",[683,784,785],{},"where an instance's content goes, in a component's own tree",[683,787,788],{},[627,789,790],{},"\u003Cslot name=\"…\">",[665,792,793,798,809],{},[683,794,795],{},[627,796,797],{},"island",[683,799,800,801,804,805,808],{},"rendered per visitor on the server (",[627,802,803],{},"server","), or hydrated with state (",[627,806,807],{},"client",")",[683,810,811,814,815],{},[627,812,813],{},"server:defer",", ",[627,816,817],{},"client:load",[665,819,820,825,828],{},[683,821,822],{},[627,823,824],{},"embed",[683,826,827],{},"raw HTML, behind its own permission, sanitised into elements by the rendering core",[683,829,830],{},[627,831,832],{},"{@html …}",[834,835,840],"pre",{"className":836,"code":837,"language":838,"meta":839,"style":839},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { insertNode, readTree, validateTree, diffTrees, type NodeTree } from '@shadestack\u002Ftree'\n\nconst tree: NodeTree = {\n  version: 2,\n  nodes: [{\n    id: 'intro', type: 'element', tag: 'section',\n    children: [\n      { id: 'title', type: 'element', tag: 'h1', children: [\n        { id: 'title-text', type: 'text', value: { kind: 'binding', expression: { type: 'path', root: 'entry', keys: ['title'] } } }\n      ] },\n      { id: 'lead', type: 'element', tag: 'p', children: [\n        { id: 'lead-text', type: 'text', value: { kind: 'literal', value: { nl: 'Welkom', en: 'Welcome' } } }\n      ] }\n    ]\n  }]\n}\n\nconst result = validateTree(tree, {\n  languages: { default: 'nl', others: ['en'] },\n  components: name => library[name], \u002F\u002F what an instance is checked against\n  expressions: createExpressionChecker({ entry: entryType, site: siteType }), \u002F\u002F types every name in scope\n  embeds: user.mayEmbed \u002F\u002F the permission to save raw HTML embeds\n})\nif (!result.ok) console.log(result.issues) \u002F\u002F [{ code, path, nodeId, message }]\n","ts","",[627,841,842,899,906,928,944,958,1002,1013,1065,1175,1184,1232,1318,1326,1332,1341,1346,1351,1372,1414,1438,1482,1502,1510],{"__ignoreMap":839},[843,844,847,851,855,859,862,865,867,870,872,875,877,880,883,886,889,892,896],"span",{"class":845,"line":846},"line",1,[843,848,850],{"class":849},"s7zQu","import",[843,852,854],{"class":853},"sMK4o"," {",[843,856,858],{"class":857},"sTEyZ"," insertNode",[843,860,861],{"class":853},",",[843,863,864],{"class":857}," readTree",[843,866,861],{"class":853},[843,868,869],{"class":857}," validateTree",[843,871,861],{"class":853},[843,873,874],{"class":857}," diffTrees",[843,876,861],{"class":853},[843,878,879],{"class":849}," type",[843,881,882],{"class":857}," NodeTree",[843,884,885],{"class":853}," }",[843,887,888],{"class":849}," from",[843,890,891],{"class":853}," '",[843,893,895],{"class":894},"sfazB","@shadestack\u002Ftree",[843,897,898],{"class":853},"'\n",[843,900,902],{"class":845,"line":901},2,[843,903,905],{"emptyLinePlaceholder":904},true,"\n",[843,907,909,913,916,919,922,925],{"class":845,"line":908},3,[843,910,912],{"class":911},"spNyl","const",[843,914,915],{"class":857}," tree",[843,917,918],{"class":853},":",[843,920,882],{"class":921},"sBMFI",[843,923,924],{"class":853}," =",[843,926,927],{"class":853}," {\n",[843,929,931,935,937,941],{"class":845,"line":930},4,[843,932,934],{"class":933},"swJcz","  version",[843,936,918],{"class":853},[843,938,940],{"class":939},"sbssI"," 2",[843,942,943],{"class":853},",\n",[843,945,947,950,952,955],{"class":845,"line":946},5,[843,948,949],{"class":933},"  nodes",[843,951,918],{"class":853},[843,953,954],{"class":857}," [",[843,956,957],{"class":853},"{\n",[843,959,961,964,966,968,971,974,976,978,980,982,984,986,988,991,993,995,998,1000],{"class":845,"line":960},6,[843,962,963],{"class":933},"    id",[843,965,918],{"class":853},[843,967,891],{"class":853},[843,969,970],{"class":894},"intro",[843,972,973],{"class":853},"'",[843,975,861],{"class":853},[843,977,879],{"class":933},[843,979,918],{"class":853},[843,981,891],{"class":853},[843,983,687],{"class":894},[843,985,973],{"class":853},[843,987,861],{"class":853},[843,989,990],{"class":933}," tag",[843,992,918],{"class":853},[843,994,891],{"class":853},[843,996,997],{"class":894},"section",[843,999,973],{"class":853},[843,1001,943],{"class":853},[843,1003,1005,1008,1010],{"class":845,"line":1004},7,[843,1006,1007],{"class":933},"    children",[843,1009,918],{"class":853},[843,1011,1012],{"class":857}," [\n",[843,1014,1016,1019,1022,1024,1026,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047,1049,1051,1054,1056,1058,1061,1063],{"class":845,"line":1015},8,[843,1017,1018],{"class":853},"      {",[843,1020,1021],{"class":933}," id",[843,1023,918],{"class":853},[843,1025,891],{"class":853},[843,1027,1028],{"class":894},"title",[843,1030,973],{"class":853},[843,1032,861],{"class":853},[843,1034,879],{"class":933},[843,1036,918],{"class":853},[843,1038,891],{"class":853},[843,1040,687],{"class":894},[843,1042,973],{"class":853},[843,1044,861],{"class":853},[843,1046,990],{"class":933},[843,1048,918],{"class":853},[843,1050,891],{"class":853},[843,1052,1053],{"class":894},"h1",[843,1055,973],{"class":853},[843,1057,861],{"class":853},[843,1059,1060],{"class":933}," children",[843,1062,918],{"class":853},[843,1064,1012],{"class":857},[843,1066,1068,1071,1073,1075,1077,1080,1082,1084,1086,1088,1090,1092,1094,1096,1099,1101,1103,1106,1108,1110,1113,1115,1117,1120,1122,1124,1126,1128,1130,1133,1135,1137,1140,1142,1144,1147,1149,1151,1154,1156,1158,1160,1162,1164,1167,1170,1172],{"class":845,"line":1067},9,[843,1069,1070],{"class":853},"        {",[843,1072,1021],{"class":933},[843,1074,918],{"class":853},[843,1076,891],{"class":853},[843,1078,1079],{"class":894},"title-text",[843,1081,973],{"class":853},[843,1083,861],{"class":853},[843,1085,879],{"class":933},[843,1087,918],{"class":853},[843,1089,891],{"class":853},[843,1091,702],{"class":894},[843,1093,973],{"class":853},[843,1095,861],{"class":853},[843,1097,1098],{"class":933}," value",[843,1100,918],{"class":853},[843,1102,854],{"class":853},[843,1104,1105],{"class":933}," kind",[843,1107,918],{"class":853},[843,1109,891],{"class":853},[843,1111,1112],{"class":894},"binding",[843,1114,973],{"class":853},[843,1116,861],{"class":853},[843,1118,1119],{"class":933}," expression",[843,1121,918],{"class":853},[843,1123,854],{"class":853},[843,1125,879],{"class":933},[843,1127,918],{"class":853},[843,1129,891],{"class":853},[843,1131,1132],{"class":894},"path",[843,1134,973],{"class":853},[843,1136,861],{"class":853},[843,1138,1139],{"class":933}," root",[843,1141,918],{"class":853},[843,1143,891],{"class":853},[843,1145,1146],{"class":894},"entry",[843,1148,973],{"class":853},[843,1150,861],{"class":853},[843,1152,1153],{"class":933}," keys",[843,1155,918],{"class":853},[843,1157,954],{"class":857},[843,1159,973],{"class":853},[843,1161,1028],{"class":894},[843,1163,973],{"class":853},[843,1165,1166],{"class":857},"] ",[843,1168,1169],{"class":853},"}",[843,1171,885],{"class":853},[843,1173,1174],{"class":853}," }\n",[843,1176,1178,1181],{"class":845,"line":1177},10,[843,1179,1180],{"class":857},"      ] ",[843,1182,1183],{"class":853},"},\n",[843,1185,1187,1189,1191,1193,1195,1198,1200,1202,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224,1226,1228,1230],{"class":845,"line":1186},11,[843,1188,1018],{"class":853},[843,1190,1021],{"class":933},[843,1192,918],{"class":853},[843,1194,891],{"class":853},[843,1196,1197],{"class":894},"lead",[843,1199,973],{"class":853},[843,1201,861],{"class":853},[843,1203,879],{"class":933},[843,1205,918],{"class":853},[843,1207,891],{"class":853},[843,1209,687],{"class":894},[843,1211,973],{"class":853},[843,1213,861],{"class":853},[843,1215,990],{"class":933},[843,1217,918],{"class":853},[843,1219,891],{"class":853},[843,1221,619],{"class":894},[843,1223,973],{"class":853},[843,1225,861],{"class":853},[843,1227,1060],{"class":933},[843,1229,918],{"class":853},[843,1231,1012],{"class":857},[843,1233,1235,1237,1239,1241,1243,1246,1248,1250,1252,1254,1256,1258,1260,1262,1264,1266,1268,1270,1272,1274,1277,1279,1281,1283,1285,1287,1290,1292,1294,1297,1299,1301,1304,1306,1308,1310,1312,1314,1316],{"class":845,"line":1234},12,[843,1236,1070],{"class":853},[843,1238,1021],{"class":933},[843,1240,918],{"class":853},[843,1242,891],{"class":853},[843,1244,1245],{"class":894},"lead-text",[843,1247,973],{"class":853},[843,1249,861],{"class":853},[843,1251,879],{"class":933},[843,1253,918],{"class":853},[843,1255,891],{"class":853},[843,1257,702],{"class":894},[843,1259,973],{"class":853},[843,1261,861],{"class":853},[843,1263,1098],{"class":933},[843,1265,918],{"class":853},[843,1267,854],{"class":853},[843,1269,1105],{"class":933},[843,1271,918],{"class":853},[843,1273,891],{"class":853},[843,1275,1276],{"class":894},"literal",[843,1278,973],{"class":853},[843,1280,861],{"class":853},[843,1282,1098],{"class":933},[843,1284,918],{"class":853},[843,1286,854],{"class":853},[843,1288,1289],{"class":933}," nl",[843,1291,918],{"class":853},[843,1293,891],{"class":853},[843,1295,1296],{"class":894},"Welkom",[843,1298,973],{"class":853},[843,1300,861],{"class":853},[843,1302,1303],{"class":933}," en",[843,1305,918],{"class":853},[843,1307,891],{"class":853},[843,1309,710],{"class":894},[843,1311,973],{"class":853},[843,1313,885],{"class":853},[843,1315,885],{"class":853},[843,1317,1174],{"class":853},[843,1319,1321,1323],{"class":845,"line":1320},13,[843,1322,1180],{"class":857},[843,1324,1325],{"class":853},"}\n",[843,1327,1329],{"class":845,"line":1328},14,[843,1330,1331],{"class":857},"    ]\n",[843,1333,1335,1338],{"class":845,"line":1334},15,[843,1336,1337],{"class":853},"  }",[843,1339,1340],{"class":857},"]\n",[843,1342,1344],{"class":845,"line":1343},16,[843,1345,1325],{"class":853},[843,1347,1349],{"class":845,"line":1348},17,[843,1350,905],{"emptyLinePlaceholder":904},[843,1352,1354,1356,1359,1362,1365,1368,1370],{"class":845,"line":1353},18,[843,1355,912],{"class":911},[843,1357,1358],{"class":857}," result ",[843,1360,1361],{"class":853},"=",[843,1363,869],{"class":1364},"s2Zo4",[843,1366,1367],{"class":857},"(tree",[843,1369,861],{"class":853},[843,1371,927],{"class":853},[843,1373,1375,1378,1380,1382,1385,1387,1389,1392,1394,1396,1399,1401,1403,1405,1408,1410,1412],{"class":845,"line":1374},19,[843,1376,1377],{"class":933},"  languages",[843,1379,918],{"class":853},[843,1381,854],{"class":853},[843,1383,1384],{"class":933}," default",[843,1386,918],{"class":853},[843,1388,891],{"class":853},[843,1390,1391],{"class":894},"nl",[843,1393,973],{"class":853},[843,1395,861],{"class":853},[843,1397,1398],{"class":933}," others",[843,1400,918],{"class":853},[843,1402,954],{"class":857},[843,1404,973],{"class":853},[843,1406,1407],{"class":894},"en",[843,1409,973],{"class":853},[843,1411,1166],{"class":857},[843,1413,1183],{"class":853},[843,1415,1417,1420,1422,1426,1429,1432,1434],{"class":845,"line":1416},20,[843,1418,1419],{"class":1364},"  components",[843,1421,918],{"class":853},[843,1423,1425],{"class":1424},"sHdIc"," name",[843,1427,1428],{"class":911}," =>",[843,1430,1431],{"class":857}," library[name]",[843,1433,861],{"class":853},[843,1435,1437],{"class":1436},"sHwdD"," \u002F\u002F what an instance is checked against\n",[843,1439,1441,1444,1446,1449,1452,1455,1458,1460,1463,1465,1468,1470,1473,1475,1477,1479],{"class":845,"line":1440},21,[843,1442,1443],{"class":933},"  expressions",[843,1445,918],{"class":853},[843,1447,1448],{"class":1364}," createExpressionChecker",[843,1450,1451],{"class":857},"(",[843,1453,1454],{"class":853},"{",[843,1456,1457],{"class":933}," entry",[843,1459,918],{"class":853},[843,1461,1462],{"class":857}," entryType",[843,1464,861],{"class":853},[843,1466,1467],{"class":933}," site",[843,1469,918],{"class":853},[843,1471,1472],{"class":857}," siteType ",[843,1474,1169],{"class":853},[843,1476,808],{"class":857},[843,1478,861],{"class":853},[843,1480,1481],{"class":1436}," \u002F\u002F types every name in scope\n",[843,1483,1485,1488,1490,1493,1496,1499],{"class":845,"line":1484},22,[843,1486,1487],{"class":933},"  embeds",[843,1489,918],{"class":853},[843,1491,1492],{"class":857}," user",[843,1494,1495],{"class":853},".",[843,1497,1498],{"class":857},"mayEmbed ",[843,1500,1501],{"class":1436},"\u002F\u002F the permission to save raw HTML embeds\n",[843,1503,1505,1507],{"class":845,"line":1504},23,[843,1506,1169],{"class":853},[843,1508,1509],{"class":857},")\n",[843,1511,1513,1515,1518,1521,1524,1526,1529,1531,1534,1537,1539,1542],{"class":845,"line":1512},24,[843,1514,744],{"class":849},[843,1516,1517],{"class":857}," (",[843,1519,1520],{"class":853},"!",[843,1522,1523],{"class":857},"result",[843,1525,1495],{"class":853},[843,1527,1528],{"class":857},"ok) console",[843,1530,1495],{"class":853},[843,1532,1533],{"class":1364},"log",[843,1535,1536],{"class":857},"(result",[843,1538,1495],{"class":853},[843,1540,1541],{"class":857},"issues) ",[843,1543,1544],{"class":1436},"\u002F\u002F [{ code, path, nodeId, message }]\n",[1546,1547,1548,1669,1775,1973,2004,2082,2125,2184,2214,2271,2297,2326,2397],"ul",{},[1549,1550,1551,1555,1556,1559,1560,1563,1564,1567,1568,1571,1572,1575,1576,1579,1580,1517,1583,1586,1587,1590,1591,1594,1595,1598,1599,1602,1603,1517,1606,814,1609,814,1612,1615,1616,1619,1620,814,1623,1559,1626,1629,1630,1633,1634,1637,1638,1559,1641,1644,1645,1648,1649,1652,1653,1559,1656,1659,1660,814,1663,814,1665,1559,1667,1495],"li",{},[1552,1553,1554],"strong",{},"Values"," are tagged: ",[627,1557,1558],{},"{ kind: 'literal', value }"," or ",[627,1561,1562],{},"{ kind: 'binding', expression }",". Text, and every\ntranslatable attribute or property, is per language: ",[627,1565,1566],{},"{ nl: '…', en: '…' }",". An image's ",[627,1569,1570],{},"src"," is a\nmedia library image, ",[627,1573,1574],{},"{ mediaId }",", which the renderer resolves to its address (or an address on the site).\nA link's ",[627,1577,1578],{},"href"," is an address or a page by id, ",[627,1581,1582],{},"{ kind: 'entry', collection, id, anchor? }",[627,1584,1585],{},"EntryLink",", a ",[627,1588,1589],{},"url","\nattribute with ",[627,1592,1593],{},"entries"," in ",[627,1596,1597],{},"html.ts","), which the renderer resolves to that page's address in the page's language\nthrough ",[627,1600,1601],{},"links",", as navigation links are; one without an address there is left out and reported. Ids, names,\nenums and tokens are literal only, except an enum marked ",[627,1604,1605],{},"bindable",[627,1607,1608],{},"aria-current",[627,1610,1611],{},"isBindable",[627,1613,1614],{},"bindingType","),\nwhose binding gives text held to its values when rendered, and the ",[627,1617,1618],{},"name"," of an ",[627,1621,1622],{},"input",[627,1624,1625],{},"select",[627,1627,1628],{},"textarea",", so\na form's controls can be drawn from data (the forms module's Form starter names each by its field's key). A bound\ncontrol name is checked when rendered (",[627,1631,1632],{},"isBoundNameAllowed","): lowercase letters, digits and dashes (",[627,1635,1636],{},"BOUND_NAME",") and\nnever a property of the page or a form, such as ",[627,1639,1640],{},"action",[627,1642,1643],{},"submit"," (DOM clobbering); any other leaves the name out,\nso the control sends nothing, and is reported. A form's, a fieldset's and an output's name, and every ",[627,1646,1647],{},"type"," and\n",[627,1650,1651],{},"id",", stay literal. The only roles a tree sets are a live region's,\n",[627,1654,1655],{},"role=\"status\"",[627,1657,1658],{},"role=\"alert\"",", on a ",[627,1661,1662],{},"div",[627,1664,619],{},[627,1666,843],{},[627,1668,997],{},[1549,1670,1671,1674,1675,1677,1678,1681,1682,1684,1685,1688,1689,1692,1693,1696,1697,1700,1701,1704,1705,1708,1709,1712,1713,1716,1717,1720,1721,1724,1725,1728,1729,1731,1732,1735,1736,1739,1740,1743,1744,1747,1748,1751,1752,1755,1756,1758,1759,1762,1763,1766,1767,1770,1771,1774],{},[1552,1672,1673],{},"Expressions"," are ",[627,1676,629],{},"' AST. ",[627,1679,1680],{},"validateTree"," decides where a binding may stand,\nwhat type it must give there and which names are in scope (",[627,1683,1146],{}," and ",[627,1686,1687],{},"site"," everywhere, ",[627,1690,1691],{},"visitor"," only inside a\nserver island, ",[627,1694,1695],{},"state"," only inside a client island, ",[627,1698,1699],{},"props"," only in a component's own tree, ",[627,1702,1703],{},"event"," only in an\nevent's actions, and each enclosing Each's item and index), and passes that to the ",[627,1706,1707],{},"expressions"," checker.\n",[627,1710,1711],{},"createExpressionChecker(environment)"," is that checker: give it the types of the entry, the site, the visitor's\nprojection, a component's properties (",[627,1714,1715],{},"propertyTypes(interface.props)","), the data sources' items (",[627,1718,1719],{},"sources",") and the\nsite's translation keys; what it has no type for can't be read. Each place accepts what ",[627,1722,1723],{},"EXPECTED"," says (a text\nshows nothing for an empty value, a condition must decide; a text node may show rich text, ",[627,1726,1727],{},"content","; a URL place\ntakes a link or a media library image too, resolved to its address when rendered), and an issue's ",[627,1730,1132],{}," points into the expression\n(",[627,1733,1734],{},"nodes.0.value.expression.args.0","). A checker is told the place (",[627,1737,1738],{},"ExpressionPlace","): what it expects, the scope,\nfor a URL its schemes, and for ",[627,1741,1742],{},"setState"," the state's exact type. A bound URL's texts that are known when the tree\nis saved (a literal, a ternary's or a ",[627,1745,1746],{},"??","'s literal branch, a literal start such as ",[627,1749,1750],{},"'javascript:' + x",") go\nthrough the attribute's allow-list then (",[627,1753,1754],{},"knownUrlProblem","; more than 64 such texts and the binding is refused,\nnever checked in part); the rest is checked when it is shown (the runtime's\n",[627,1757,1589],{},"). Each loop's item is typed once, where its Each stands (",[627,1760,1761],{},"ScopeItem.scope","), so checking is linear in the\ntree's size, and a tree's expressions may hold at most ",[627,1764,1765],{},"maxExpressionParts"," parts together (default 50,000). Without\na checker every binding is refused; without ",[627,1768,1769],{},"components"," every component instance is; without ",[627,1772,1773],{},"embeds: true"," every\nembed is.",[1549,1776,1777,1780,1781,1517,1784,814,1787,943,1789,814,1792,814,1794,1797,1798,814,1801,1804,1805,943,1807,814,1810,1813,1814,1817,1818,1821,1822,1825,1826,1829,1830,1833,1834,1837,1838,1841,1842,1845,1846,1849,1850,1853,1854,1857,1858,1861,1862,1864,1865,1684,1867,1870,1871,1874,1875,1878,1879,1882,1883,1885,1886,1888,1889,1892,1893,1896,1897,1900,1901,1559,1903,1906,1907,1517,1910,1913,1914,1916,1917,1919,1920,1922,1923,1926,1927,1930,1931,1934,1935,1937,1938,1940,1941,1684,1944,1947,1948,1950,1951,1953,1954,1956,1957,1959,1960,1963,1964,1967,1968,814,1970,1972],{},[1552,1778,1779],{},"Events and actions",": an element inside a client island may answer ",[627,1782,1783],{},"events",[627,1785,1786],{},"click",[627,1788,1643],{},[627,1790,1791],{},"change",[627,1793,1622],{},[627,1795,1796],{},"keydown"," narrowed to a ",[627,1799,1800],{},"key",[627,1802,1803],{},"load","), each with actions run in order: ",[627,1806,1742],{},[627,1808,1809],{},"toggleState",[627,1811,1812],{},"navigate"," (the link scheme allow-list), ",[627,1815,1816],{},"submitForm"," (a form of the island, by id), ",[627,1819,1820],{},"callRoute"," (a\nmodule's public or account route, through ",[627,1823,1824],{},"callAccountRoute"," at SHADE's account API (",[627,1827,1828],{},"accountApiBase",", the page's\n",[627,1831,1832],{},"shade-account-api"," address), with values in its body and its address and maybe a form of the island, its answer kept\nin an ",[627,1835,1836],{},"answer"," state of that route and how it went in a text state; ",[627,1839,1840],{},"challenge"," solves the module's proof of work first and sends it as ",[627,1843,1844],{},"altcha","), ",[627,1847,1848],{},"playInteraction",", and ",[627,1851,1852],{},"account"," (a step of\nSHADE's own account routes, ",[627,1855,1856],{},"ACCOUNT_STEPS",": how it went in a text state, ",[627,1859,1860],{},"ACCOUNT_STATUSES",", and who is signed in\nin an ",[627,1863,1852],{}," state of ",[627,1866,1618],{},[627,1868,1869],{},"email","; only ",[627,1872,1873],{},"session"," runs on load; a step with a form sends its fields by the\nnames ",[627,1876,1877],{},"ACCOUNT_FIELDS"," gives). A password field (",[627,1880,1881],{},"type=\"password\"",") stands only in a form of a client island, takes\nno events, and its form goes only to ",[627,1884,1852],{},", never ",[627,1887,1820],{},"; the renderer writes that form with\n",[627,1890,1891],{},"method=\"post\"",". Text, number and on\u002Foff state\nmay be ",[627,1894,1895],{},"kept"," in the visitor's browser, shared by every island of the site with a kept state of that name. A text\nstate may have a fixed set of ",[627,1898,1899],{},"options"," (2–16 lower-case names such as ",[627,1902,1687],{},[627,1904,1905],{},"all-plugins",") and a number a\n",[627,1908,1909],{},"range",[627,1911,1912],{},"{ min, max }","); styles read them through the island's wrapper (see\n",[623,1915,517],{"href":518},"), so neither may be ",[627,1918,1895],{},", the first value is one of the\noptions or inside the range, and a ",[627,1921,1742],{}," with a literal outside the options is refused when saving (a computed\none at run time, like a value of another type). The runtime writes the options' values as\n",[627,1924,1925],{},"data-shade-state=\"picked:site\""," on ",[627,1928,1929],{},"\u003Cshade-island>",", already in the first view, and each number kept to its range\nas ",[627,1932,1933],{},"--shade-value-\u003Cname>"," once the island runs, at most once a frame. Events stand only inside client islands\nand on elements that answer them, in ",[627,1936,1680],{}," and the operations alike; ",[627,1939,1680],{}," checks actions against\nthe island's state and forms, ",[627,1942,1943],{},"visitorRoutes(plugin, method, route)",[627,1945,1946],{},"interactions(id)",", and refuses every route\ncall and interaction without those lookups. ",[627,1949,1742],{}," takes exactly the state's type (never nothing, a list's\nitems of its type, never a data source); a bound ",[627,1952,1812],{}," target is never nothing, its known texts are checked\nwhen saved and the islands' runtime checks what it gives with ",[627,1955,1589],{}," before going. ",[627,1958,1803],{}," runs without the visitor\ndoing anything, so it takes only ",[627,1961,1962],{},"LOAD_ACTIONS",": set or toggle state, play an interaction, or a ",[627,1965,1966],{},"GET"," route call;\nnever ",[627,1969,1812],{},[627,1971,1816],{}," or a route call that changes something.",[1549,1974,1975,1978,1979,1982,1983,1986,1987,1989,1990,1993,1994,1996,1997,1517,2000,2003],{},[1552,1976,1977],{},"Loops over data sources",": an Each's ",[627,1980,1981],{},"source"," is a data source written in the tree\n(",[627,1984,1985],{},"{ kind: 'literal', value: { source: 'collection:posts', parameters: { order: 'newest', limit: 6 } } }","), whose\nitems the renderer fetches on the server, or a binding that gives a list or a source. A component property of type\n",[627,1988,1981],{}," holds a data source, so an Each in the component's tree can loop over ",[627,1991,1992],{},"props.feed",": a ",[627,1995,1981],{}," counts as a\n",[627,1998,1999],{},"list",[627,2001,2002],{},"acceptsValue",").",[1549,2005,2006,2012,2013,814,2016,814,2019,814,2022,814,2025,943,2028,2031,2032,2035,2036,2038,2039,2041,2042,2045,2046,814,2048,814,2050,814,2053,2055,2056,1559,2059,2062,2063,814,2065,814,2067,2070,2071,1648,2074,2077,2078,2081],{},[1552,2007,2008,2009,2011],{},"What ",[627,2010,1680],{}," refuses:"," tags off the allow-list (",[627,2014,2015],{},"script",[627,2017,2018],{},"style",[627,2020,2021],{},"iframe",[627,2023,2024],{},"svg",[627,2026,2027],{},"object",[627,2029,2030],{},"template","…), attributes a tag doesn't take, every ",[627,2033,2034],{},"on*"," attribute, ",[627,2037,2018],{},", a form's ",[627,2040,1640],{},", URLs outside the\nscheme allow-lists (",[627,2043,2044],{},"urls.ts",": links http, https, mailto, tel; audio, video, tracks and posters https; relative\npaths; whitespace, control characters and backslashes refused), images from another host, ids and form names that\nare a property of the document, a form or the window (",[627,2047,1643],{},[627,2049,1640],{},[627,2051,2052],{},"cookie",[627,2054,1618],{},"…: DOM clobbering), names\nsuch as ",[627,2057,2058],{},"constructor",[627,2060,2061],{},"toString",", an interactive element inside another (also in a summary), flow content where\nonly phrasing may stand, misplaced list items, table rows (only in ",[627,2064,662],{},[627,2066,678],{},[627,2068,2069],{},"tfoot","), table cells, ",[627,2072,2073],{},"dt",[627,2075,2076],{},"dd",", and options, islands where only some tags or only text may stand, children in void elements, duplicate ids,\nlocks on fields a node doesn't have, oversized or too deep input (checked before parsing) and ",[627,2079,2080],{},"__proto__"," keys.",[1549,2083,2084,2087,2088,2091,2092,943,2095,814,2098,814,2101,814,2104,814,2107,2110,2111,814,2113,814,2116,943,2119,814,2122,2124],{},[1552,2085,2086],{},"Components are seen through, both ways."," An instance counts as the tag it renders as, with the tags, the\ninteractive content, the islands and the embeds it holds (a card holding a link can't stand in a link, a component\nholding an island not in an island, one holding an embed not in a form), and the nodes in one of its slots are\nchecked where that slot stands in the component's own tree (no link in a link component's slot).\n",[627,2089,2090],{},"describeComponent(componentTree, { components })"," computes that part of a component's interface (",[627,2093,2094],{},"root",[627,2096,2097],{},"phrasing",[627,2099,2100],{},"interactive",[627,2102,2103],{},"tags",[627,2105,2106],{},"islands",[627,2108,2109],{},"embeds",", and per slot ",[627,2112,1727],{},[627,2114,2115],{},"parentTag",[627,2117,2118],{},"forbidden",[627,2120,2121],{},"noInteractive",[627,2123,797],{},"); the library stores it with the component, a code component declares it.",[1549,2126,2127,2130,2131,2134,2135,2138,2139,1684,2142,2145,2146,1517,2149,2152,2153,2156,2157,2160,2161,2164,2165,814,2168,814,2171,814,2174,814,2177,814,2179,814,2181,2003],{},[1552,2128,2129],{},"A component as data"," is a ",[627,2132,2133],{},"ComponentDefinition"," (its tree, properties, slots, variants, default variant and\ndefaults), whoever keeps it; ",[627,2136,2137],{},"validateComponent(definition, { name, languages, components, types, visitorRoutes, forms })"," checks one without a database (properties, defaults, variants' classes, its tree as a component's, its\nslots placed once, no instance of itself), and ",[627,2140,2141],{},"instancesIn",[627,2143,2144],{},"placedSlots"," read a tree. The website module's\nlibrary and its SDK's ",[627,2147,2148],{},"checkComponent",[627,2150,2151],{},"@shadestack\u002Fmodule-website\u002Fsdk\u002Ftesting",") use it; ",[627,2154,2155],{},"@shadestack\u002Frender","'s ",[627,2158,2159],{},"LibraryComponent"," is made from it.\n",[627,2162,2163],{},"@shadestack\u002Ftree\u002Fbuild"," builds trees in code (",[627,2166,2167],{},"el",[627,2169,2170],{},"words",[627,2172,2173],{},"show",[627,2175,2176],{},"when",[627,2178,767],{},[627,2180,782],{},[627,2182,2183],{},"use",[1549,2185,2186,2189,2190,2193,2194,2197,2198,2201,2202,2205,2206,2209,2210,2213],{},[1552,2187,2188],{},"Embeds"," hold raw HTML: at most 20,000 characters, refused when they contain ",[627,2191,2192],{},"\u003Cscript",", an ",[627,2195,2196],{},"on…="," attribute, a\n",[627,2199,2200],{},"javascript:","\u002F",[627,2203,2204],{},"vbscript:"," URL (also with a tab or newline in the scheme, or written with character references such\nas ",[627,2207,2208],{},"&#x61;",") or ",[627,2211,2212],{},"srcdoc"," (a first check, not a sanitiser), and every renderer sanitises them before output. They\nstand only where flow content may, outside links, buttons and forms.",[1549,2215,2216,2219,2220,2223,2224,2227,2228,814,2231,814,2234,814,2237,2240,2241,2244,2245,2248,2249,1517,2251,2254,2255,814,2258,1684,2261,2264,2265,1684,2268,1495],{},[1552,2217,2218],{},"Locks"," (for the editor's roles): any node may carry ",[627,2221,2222],{},"locks: { structure, properties, styles }",", the\nproperties by the field names ",[627,2225,2226],{},"diffTrees"," reports (",[627,2229,2230],{},"tag",[627,2232,2233],{},"attributes.href",[627,2235,2236],{},"props.title",[627,2238,2239],{},"value","). The tree\nchecks their shape; the website module's content check enforces them when saving: ",[627,2242,2243],{},"editProblems(before, after, role)"," in\n",[627,2246,2247],{},"rights.ts"," says what a builder or content editor changed beyond their role or past a lock, each problem with a\n",[627,2250,627],{},[627,2252,2253],{},"RIGHTS_PROBLEMS","), and ",[627,2256,2257],{},"mayChangeField",[627,2259,2260],{},"mayAddTo",[627,2262,2263],{},"mayMoveOrRemove"," answer an editor's questions per\nnode. The website module's roles are ",[627,2266,2267],{},"website.pages.design",[627,2269,2270],{},"website.pages.build",[1549,2272,2273,2276,2277,2280,2281,2284,2285,2287,2288,2290,2291,2293,2294,1495],{},[1552,2274,2275],{},"Renderers"," check bound URLs again when they are known, with the runtime's ",[627,2278,2279],{},"url(value, schemes)"," (or the same\n",[627,2282,2283],{},"safeUrl(value, schemes)",", from ",[627,2286,629],{},"): the rules are ",[627,2289,629],{},"' (",[627,2292,2044],{},"), and\nthe tree re-exports the scheme lists and ",[627,2295,2296],{},"urlProblem",[1549,2298,2299,2302,2303,2306,2307,943,2310,2313,2314,2317,2318,2321,2322,2325],{},[1552,2300,2301],{},"Schema versions:"," ",[627,2304,2305],{},"readTree(stored, options)"," migrates a tree of any earlier version (",[627,2308,2309],{},"migrateTree",[627,2311,2312],{},"MIGRATIONS",") and validates it. Raising ",[627,2315,2316],{},"SCHEMA_VERSION"," without a migration fails the package's tests. Version 2\nstores expressions as their AST, parsed from version 1's ",[627,2319,2320],{},"{ expr }"," placeholders; one that doesn't\nparse, or isn't exactly ",[627,2323,2324],{},"{ expr: '\u003Cformula>' }",", stops the migration with its reason and where.",[1549,2327,2328,2302,2331,814,2334,814,2337,814,2340,814,2343,2346,2347,2350,2351,2353,2354,2356,2357,2360,2361,814,2364,2254,2367,2201,2370,2373,2374,2377,2378,2380,2381,814,2384,814,2386,814,2388,814,2391,1559,2394,1495],{},[1552,2329,2330],{},"Operations:",[627,2332,2333],{},"insertNode",[627,2335,2336],{},"moveNode",[627,2338,2339],{},"removeNode",[627,2341,2342],{},"duplicateNode",[627,2344,2345],{},"updateNode"," return a new tree and share\nuntouched subtrees; they throw ",[627,2348,2349],{},"TreeOperationError"," with a ",[627,2352,627],{}," for what the nesting rules refuse, the same rules\n",[627,2355,1680],{}," applies (",[627,2358,2359],{},"nesting.ts","). A node they are given is checked for size before its schema reads it\n(",[627,2362,2363],{},"too-large",[627,2365,2366],{},"structure",[627,2368,2369],{},"maxNodes",[627,2371,2372],{},"maxDepth"," in their rules refuse an insert, move or duplicate past\nthem. Every walk is iterative, so no tree is too deep for them. A position is ",[627,2375,2376],{},"{ parentId, list, index }",", where\n",[627,2379,1999],{}," is ",[627,2382,2383],{},"children",[627,2385,750],{},[627,2387,754],{},[627,2389,2390],{},"empty",[627,2392,2393],{},"fallback",[627,2395,2396],{},"slot:\u003Cname>",[1549,2398,2399,2302,2402,2405,2406,814,2408,814,2410,814,2413,2416,2417,2420,2421,2424],{},[1552,2400,2401],{},"Comparison:",[627,2403,2404],{},"diffTrees(before, after)"," lists nodes added, removed, moved and changed, with the changed fields\n(",[627,2407,2233],{},[627,2409,2236],{},[627,2411,2412],{},"value.nl",[627,2414,2415],{},"locks.structure","). ",[627,2418,2419],{},"summarizeChanges(before, after, locale?)"," is\nthat for a person: a removed or added subtree once, each node with its tag or component and first\nwords, at most 200 changes (",[627,2422,2423],{},"more"," counts the rest).",[619,2426,2427,2428,634,2431,2434,2435,1495],{},"Code, in ",[627,2429,2430],{},"shade-frontend",[627,2432,2433],{},"packages\u002Ftree\u002Fsrc\u002F",". Tests: ",[627,2436,2437],{},"packages\u002Ftree\u002Ftest\u002F*.test.ts",[2018,2439,2440],{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":839,"searchDepth":901,"depth":901,"links":2442},[],"md",null,{},{"title":513,"description":839},"P3RgjAPj5lq3SEDKYZdwoD2nE0aweUmNqL4sXvEuzwA",[2449,2450],{"title":509,"path":510,"stem":511,"description":839,"children":-1},{"title":517,"path":518,"stem":519,"description":839,"children":-1},1796500156636]