datalog-theme 0.9.1 → 0.9.2
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/CHANGELOG.md +9 -0
- data/CITATION.cff +1 -1
- data/_plugins/image_optimizer.rb +8 -2
- data/_plugins/math_preprocessor.rb +42 -2
- data/assets/js/dist/comments.js +2 -2
- data/assets/js/dist/moderation.js +1 -1
- data/assets/js/dist/sources.json +3 -3
- data/assets/js/dist/subscriptions.js +1 -1
- data/lib/datalog/theme/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e78d28d83ac0a0f18ae06135f8d07b0523f4b1669bfe838cf7cb146a77c54307
|
|
4
|
+
data.tar.gz: 2f75e9074b965a7edfd417194145ad50ed44a03aa93d789d86ddde7ae4a7a5ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 00f97bd9e578136be77bffc0aa079ad80d9498a8f7becce2162d7ca948920b32fe8387e0f977f6a404a05d5c7a0960dad84f915fefe07ee2844b9d36fb7a5351
|
|
7
|
+
data.tar.gz: 469a1d9ec77a2e9379979fb392a0bd2d6888516742931599bb8fa3457375a17ec85b7b3d322b8d72018129999b7dda91e7123b6fc906eef5e8fddc4c1d952311
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## [0.9.2] - 2026-09-20
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Keep newly posted comments visible when an older thread read finishes, and refresh moderation reads that overlap completed actions without losing their filters or pagination.
|
|
10
|
+
- Retry subscription preference saves with the edited topics, clearing retry handlers left by earlier loading failures.
|
|
11
|
+
- Preserve indented code blocks during math preprocessing, distinguish them from indented prose, and accept longer closing code fences so following math is still detected.
|
|
12
|
+
- Percent-encode generated image paths once in the responsive manifest so filenames containing spaces produce valid image candidates in Markdown and responsive-image includes.
|
|
13
|
+
|
|
5
14
|
## [0.9.1] - 2026-09-20
|
|
6
15
|
|
|
7
16
|
Planned patch release: **0.9.1**. This release contains bug fixes only.
|
data/CITATION.cff
CHANGED
|
@@ -16,7 +16,7 @@ abstract: >-
|
|
|
16
16
|
It offers integrated notebook publishing, advanced math rendering, interactive
|
|
17
17
|
visualization workflows, and reproducibility tooling optimised for open science communities.
|
|
18
18
|
license: MIT
|
|
19
|
-
version: 0.9.
|
|
19
|
+
version: 0.9.2
|
|
20
20
|
date-released: 2026-09-20
|
|
21
21
|
keywords:
|
|
22
22
|
- data-science
|
data/_plugins/image_optimizer.rb
CHANGED
|
@@ -422,13 +422,19 @@ module Jekyll
|
|
|
422
422
|
|
|
423
423
|
def original_variant(src, width, height)
|
|
424
424
|
{
|
|
425
|
-
"url" => src,
|
|
425
|
+
"url" => encode_image_path(src),
|
|
426
426
|
"width" => width,
|
|
427
427
|
"height" => height,
|
|
428
428
|
"format" => normalize_format(File.extname(src))
|
|
429
429
|
}
|
|
430
430
|
end
|
|
431
431
|
|
|
432
|
+
# These are filesystem paths, not already escaped URLs. Encode them once
|
|
433
|
+
# when creating the manifest so both Markdown and the include use valid srcsets.
|
|
434
|
+
def encode_image_path(path)
|
|
435
|
+
path.split("/", -1).map { |part| URI.encode_www_form_component(part).gsub("+", "%20") }.join("/")
|
|
436
|
+
end
|
|
437
|
+
|
|
432
438
|
# Variant URLs are site paths. A site served below a baseurl needs it in
|
|
433
439
|
# front of them, as relative_url adds it in templates.
|
|
434
440
|
def build_srcset(variants, baseurl = "")
|
|
@@ -477,7 +483,7 @@ class Jekyll::ResponsiveImageStaticFile < Jekyll::StaticFile
|
|
|
477
483
|
def initialize(site, relative_dir, name, cached_path)
|
|
478
484
|
@cached_path = cached_path
|
|
479
485
|
super(site, site.source, "/#{relative_dir}", name)
|
|
480
|
-
@url = "/#{relative_dir}/#{name}"
|
|
486
|
+
@url = Jekyll::ImageOptimizer.encode_image_path("/#{relative_dir}/#{name}")
|
|
481
487
|
end
|
|
482
488
|
|
|
483
489
|
def path
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "cgi"
|
|
4
|
+
require "kramdown"
|
|
5
|
+
require "kramdown-parser-gfm"
|
|
4
6
|
|
|
5
7
|
module MathPreprocessor
|
|
6
8
|
DISPLAY_PATTERNS = [
|
|
@@ -46,7 +48,7 @@ module MathPreprocessor
|
|
|
46
48
|
# so fenced blocks, highlight tags, <pre>/<code> elements and inline code
|
|
47
49
|
# spans are set aside before looking for math and put back afterwards.
|
|
48
50
|
CODE_PATTERNS = [
|
|
49
|
-
/^
|
|
51
|
+
/^[ \t]*(?<fence>(?<marker>`|~)\k<marker>{2,})[^\n]*\n.*?(?:^[ \t]*\k<fence>\k<marker>*[ \t]*$|\z)/m,
|
|
50
52
|
/\{%-?\s*highlight\b.*?\{%-?\s*endhighlight\s*-?%\}/m,
|
|
51
53
|
%r{<(pre|code)\b[^>]*>.*?</\1>}mi,
|
|
52
54
|
/(?<!`)(`+)(?!`)(?:(?!\n[ \t]*\n).)+?(?<!`)\1(?!`)/m
|
|
@@ -56,6 +58,31 @@ module MathPreprocessor
|
|
|
56
58
|
# an escape: a raw NUL byte in the source stopped RuboCop from parsing the file.
|
|
57
59
|
PLACEHOLDER = /\x00(\d+)\x00/
|
|
58
60
|
|
|
61
|
+
# Indentation alone does not identify code: list continuations and continued
|
|
62
|
+
# paragraphs can have the same indentation. Let the Markdown parser identify
|
|
63
|
+
# the code blocks, retaining their original source lines for masking.
|
|
64
|
+
class IndentedCodeParser < Kramdown::Parser::GFM
|
|
65
|
+
attr_reader :code_ranges
|
|
66
|
+
|
|
67
|
+
def initialize(source, options)
|
|
68
|
+
super
|
|
69
|
+
@code_ranges = []
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def parse_codeblock
|
|
73
|
+
first = @src.current_line_number - 1
|
|
74
|
+
super.tap do |parsed|
|
|
75
|
+
@code_ranges << (first...(@src.current_line_number - 1)) if parsed
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def self.ranges(source)
|
|
80
|
+
parser = new(source, {})
|
|
81
|
+
parser.parse
|
|
82
|
+
parser.code_ranges
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
59
86
|
class Processor
|
|
60
87
|
attr_reader :expressions
|
|
61
88
|
|
|
@@ -68,7 +95,7 @@ module MathPreprocessor
|
|
|
68
95
|
return @content unless @content&.match?(/\$|\\\(|\\\[|\\begin\{/)
|
|
69
96
|
|
|
70
97
|
@segments = []
|
|
71
|
-
processed = CODE_PATTERNS.reduce(@content
|
|
98
|
+
processed = CODE_PATTERNS.reduce(mask_indented_code(@content)) do |text, pattern|
|
|
72
99
|
text.gsub(pattern) { |match| mask(match) }
|
|
73
100
|
end
|
|
74
101
|
processed = normalize_inline_dollars(processed)
|
|
@@ -86,6 +113,19 @@ module MathPreprocessor
|
|
|
86
113
|
"\x00#{@segments.size - 1}\x00"
|
|
87
114
|
end
|
|
88
115
|
|
|
116
|
+
def mask_indented_code(text)
|
|
117
|
+
return text unless text.match?(/^(?: {4}|\t)/)
|
|
118
|
+
|
|
119
|
+
lines = text.lines
|
|
120
|
+
IndentedCodeParser.ranges(text).reverse_each do |range|
|
|
121
|
+
block = lines[range].join
|
|
122
|
+
# Keep the final line boundary visible to subsequent block patterns.
|
|
123
|
+
ending = block.end_with?("\n") ? "\n" : ""
|
|
124
|
+
lines[range] = [mask(block.delete_suffix(ending)) + ending]
|
|
125
|
+
end
|
|
126
|
+
lines.join
|
|
127
|
+
end
|
|
128
|
+
|
|
89
129
|
# Kramdown accepts $$...$$ inside prose as inline math. A div there is
|
|
90
130
|
# escaped by Markdown and leaks its attributes into the visible article.
|
|
91
131
|
# Normalize before wrapping; code is already masked and standalone or
|
data/assets/js/dist/comments.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`).forEach((
|
|
1
|
+
import{a as P,c as x,d as V,e as W}from"./chunks/chunk-WIRUK3OZ.js";import{a as L,b as J,c as K}from"./chunks/chunk-VZ5WKQVA.js";import{a as F,b as I}from"./chunks/chunk-PATLC23F.js";var R="comments",ee=3,Y=/^https?:\/\//i,te=new Set(["disabled","unsupported","version"]);function ne(e,t){let n=e.querySelector(t);if(!n)return{};try{return JSON.parse(n.textContent)||{}}catch(a){return{}}}function re(e,t){return Object.keys(t).reduce((n,a)=>n.split(`{{${a}}}`).join(t[a]),e)}function ae(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return String(e||"");try{return n.toLocaleString(t||void 0,{dateStyle:"medium",timeStyle:"short"})}catch(a){return n.toISOString()}}function se(e,t=!0){let n=Array.isArray(e)?e.filter(i=>i&&typeof i=="object"):[],a=new Map;n.forEach(i=>a.set(String(i.id),{comment:i,replies:[]}));let f=[];a.forEach(i=>{let s=i.comment.parent_id,p=t&&s!==null&&s!==void 0?a.get(String(s)):null;p&&p!==i?p.replies.push(i):f.push(i)});let m=(i,s)=>(Date.parse(i.comment.created_at)||0)-(Date.parse(s.comment.created_at)||0),g=i=>(i.sort(m),i.forEach(s=>g(s.replies)),i);return g(f)}function z(e,t,n={}){let{labels:a={},lang:f,replies:m=!1,onReply:g}=n,i=t.status==="pending",s=e.createElement("li");s.className=i?"comment comment--pending":"comment",t.id!==null&&t.id!==void 0&&(s.id=`comment-${t.id}`);let p=e.createElement("article");p.className="comment__card";let _=e.createElement("header");_.className="comment__meta";let h=t.author&&typeof t.author=="object"?t.author:{},y=String(h.name||"").trim()||a.anonymous||"Anonymous",o;if(Y.test(String(h.url||""))?(o=e.createElement("a"),o.href=h.url,o.rel="nofollow noopener ugc"):o=e.createElement("span"),o.className="comment__author",o.textContent=y,_.appendChild(o),t.created_at){let c=e.createElement("time");c.className="comment__time",c.dateTime=String(t.created_at),c.textContent=ae(t.created_at,f),_.appendChild(c)}if(i){let c=e.createElement("span");c.className="comment__pending",c.textContent=a.pending||"Awaiting moderation",_.appendChild(c)}p.appendChild(_);let C=e.createElement("div");if(C.className="comment__body",String(t.body||"").split(/\n{2,}/).forEach(c=>{let b=e.createElement("p");c.split(`
|
|
2
|
+
`).forEach((N,E)=>{E>0&&b.appendChild(e.createElement("br")),b.appendChild(e.createTextNode(N))}),C.appendChild(b)}),p.appendChild(C),m&&g&&!i&&t.id!==null&&t.id!==void 0){let c=e.createElement("button");c.type="button",c.className="comment__reply post-tool",c.textContent=a.reply||"Reply",c.addEventListener("click",()=>g(t)),p.appendChild(c)}return s.appendChild(p),s}function G(e,t){let n=t.querySelector(":scope > .comments-thread__replies");return n||(n=e.createElement("ol"),n.className="comments-thread__replies",t.appendChild(n)),n}function H(e,t,n,a){n.forEach(f=>{let m=z(e,f.comment,a);f.replies.length>0&&H(e,G(e,m),f.replies,a),t.appendChild(m)})}function ie(e,t){let n={name:e.name||""};return e.email&&(n.email=e.email),e.url&&(n.url=e.url),{path:t,parent_id:e.parent_id||null,author:n,body:e.body||""}}function oe(e,t,n={}){let a={};return e.author.name||(a.name=n.name_required||"Say who you are."),e.author.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.author.email)&&(a.email=n.email_invalid||"That does not look like an email address."),e.author.url&&!Y.test(e.author.url)&&(a.url=n.url_invalid||"A website address starts with http:// or https://."),e.body.trim().length<ee&&(a.body=n.body_short||"Say a little more."),t.website&&(a.website="spam"),Object.keys(a).length>0?a:null}function le(e,t={}){let n=e.ownerDocument,a=t.window||n.defaultView,f=e.dataset.commentsEndpoint||"",m=t.client||(f?J(I(F({},a&&a.DatalogDynamicServices||{}),{base_url:f})):K()),g=e.dataset.commentsPath||"/",i=e.dataset.commentsReplies!=="false",s=ne(e,"[data-comments-labels]"),p=s.errors||{},_=n.documentElement.lang||void 0,h=e.querySelector("[data-comments-status]"),y=e.querySelector("[data-comments-list]"),o=e.querySelector("form"),C=P(o),c=o?o.elements.namedItem("parent_id"):null,b=e.querySelector("[data-comments-replying]"),N=e.querySelector("[data-comments-replying-to]"),E=null,D=!1,j=!1,O=new Map,v=(r,d="",u={})=>{if(e.dataset.state=r,!!h&&(h.textContent=d,h.hidden=d==="",h.setAttribute("role",u.alert?"alert":"status"),u.retry)){let l=n.createElement("button");l.type="button",l.className="post-tool",l.setAttribute("data-comments-retry",""),l.textContent=s.retry||"Try again",l.addEventListener("click",()=>A.load()),h.appendChild(n.createTextNode(" ")),h.appendChild(l)}},k=()=>(E||(E=m.feature(R).catch(r=>{throw E=null,r})),E),$=r=>{if(!c)return;if(c.value=String(r.id),N){let u=r.author&&r.author.name?r.author.name:s.anonymous||"Anonymous";N.textContent=re(s.replying_to||"Replying to {{name}}",{name:u})}b&&(b.hidden=!1);let d=o.elements.namedItem("body");d&&typeof d.focus=="function"&&d.focus()},T=()=>{c&&(c.value=""),b&&(b.hidden=!0)},M={labels:s,lang:_,replies:i,onReply:$},Z=(r,d)=>{let u=r.id?n.getElementById(r.id):null;if(u&&y.contains(u)){let S=u.querySelector(":scope > .comments-thread__replies");S&&r.appendChild(S),u.replaceWith(r);return}let l=i&&d!==null&&d!==void 0?y.querySelector(`#comment-${CSS.escape(String(d))}`):null;(l?G(n,l):y).appendChild(r),y.hidden=!1,e.dataset.state==="empty"&&v("loaded")},A={root:e,form:o,reply:$,cancelReply:T,async load(){if(D)return null;D=!0,v("loading",s.loading||"");try{await k();let r=await m.get(`${m.pathFor(R)}?path=${encodeURIComponent(g)}`),d=r&&r.data&&Array.isArray(r.data.comments)?[...r.data.comments]:[];d.forEach(l=>{(l==null?void 0:l.id)!=null&&O.delete(String(l.id))}),d.push(...O.values()),y.textContent="";let u=se(d,i);return H(n,y,u,M),y.hidden=u.length===0,v(u.length>0?"loaded":"empty",u.length>0?"":s.empty||""),j=!0,d}catch(r){return r&&te.has(r.kind)?(v("disabled",L(r,p)),o&&(o.hidden=!0)):v("error",L(r,p),{alert:!0,retry:!0}),null}finally{D=!1}},async submit(){let r=V(o),d=ie(r,g),u=oe(d,r,s);if(u)return u.website?(x(o,"success",s.posted_pending||""),null):(x(o,"invalid",p.invalid||"",u),null);x(o,"pending",s.sending||"");try{await k();let l=await m.post(m.pathFor(R),d,{idempotencyKey:C.key(d)}),S=l&&l.data&&typeof l.data=="object"?l.data:{},w=S.comment&&typeof S.comment=="object"?S.comment:null,B=S.status==="pending"||w!==null&&w.status==="pending";if(w){let q=B?I(F({},w),{status:"pending"}):w;q.id!=null&&O.set(String(q.id),q),Z(z(n,q,M),w.parent_id)}return C.clear(),o.reset(),T(),x(o,"success",B?s.posted_pending||"":s.posted||""),l}catch(l){return W(o,l,p),null}}};o&&(o.addEventListener("submit",r=>{r.preventDefault(),A.submit()}),e.querySelectorAll("[data-comments-cancel-reply]").forEach(r=>{r.addEventListener("click",T)}));let U=()=>{j||A.load()};if(t.immediate||!a||typeof a.IntersectionObserver!="function")U();else{let r=new a.IntersectionObserver(d=>{d.some(u=>u.isIntersecting)&&(r.disconnect(),U())},{rootMargin:"400px 0px"});r.observe(e)}return A}function Q(e=document){return Array.from(e.querySelectorAll("[data-comments-thread]")).map(t=>le(t))}function X(){Q(document)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X,{once:!0}):X();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as H}from"./chunks/chunk-WIRUK3OZ.js";import{a as T,b as W}from"./chunks/chunk-VZ5WKQVA.js";import{a as O,b as B}from"./chunks/chunk-PATLC23F.js";var P="moderation",et=["comment","correction","abuse"],nt={approve:"approved",spam:"spam",hide:"hidden",delete:"deleted",reviewed:"reviewed",accept:"accepted",reject:"rejected",resolve:"resolved",dismiss:"dismissed"},ot={comment:{pending:["approve","spam","delete"],approved:["hide","spam","delete"],spam:["approve","delete"],hidden:["approve","delete"]},correction:{new:["reviewed","accept","reject"],reviewed:["accept","reject"],accepted:["resolve","reject"]},abuse:{open:["dismiss","hide","delete"]}},at={comment:["pending"],correction:["new","reviewed","accepted"],abuse:["open"]},Y=/^https?:\/\//i,rt=new Set(["unauthorized","forbidden"]),it=new Set(["disabled","unsupported","version"]);function st(t,e){let i=t.querySelector(e);if(!i)return{};try{return JSON.parse(i.textContent)||{}}catch(s){return{}}}function r(t){return typeof t=="string"?t:""}function G(t){return(ot[t.type]||{})[t.status]||[]}function J(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=r(t.type).toLowerCase();if(t.id===null||t.id===void 0||!et.includes(e))return null;let i=t.author&&typeof t.author=="object"?t.author:{},s=t.context&&typeof t.context=="object"?t.context:{},c=s.parent&&typeof s.parent=="object"?s.parent:null,u=t.resolution&&typeof t.resolution=="object"?t.resolution:{},_=Array.isArray(t.history)?t.history:[];return{id:String(t.id),type:e,status:r(t.status).toLowerCase(),created_at:r(t.created_at),path:r(t.path),title:r(t.title),author:{name:r(i.name),email:r(i.email)},body:r(t.body)||r(t.message),category:r(t.category),section:r(t.section),quote:r(t.quote),reason:r(t.reason),parent:c?{author:r(c.author&&c.author.name),body:r(c.body)}:null,link:Y.test(r(u.url))?u.url:"",history:_.filter(g=>g&&typeof g=="object").map(g=>({action:r(g.action),at:r(g.at),moderator:r(g.moderator),note:r(g.note)}))}}function lt(t={},e=""){let i=new URLSearchParams;["type","status","path","category","since","q"].forEach(c=>{let u=r(t[c]).trim();u&&u!=="all"&&i.set(c,u)}),e&&i.set("cursor",e);let s=i.toString();return s?`?${s}`:""}function K(t,e){let i=new Date(t);if(Number.isNaN(i.getTime()))return t;try{return i.toLocaleString(e||void 0,{dateStyle:"medium",timeStyle:"short"})}catch(s){return i.toISOString()}}function o(t,e,i,s,c){let u=t.createElement(i);return s&&(u.className=s),c!==void 0&&(u.textContent=c),e.appendChild(u),u}function V(t,e,i={}){let{labels:s={},lang:c,siteUrl:u="",onAction:_}=i,g=s.types||{},h=s.statuses||{},j=s.actions||{},C=t.createElement("li");C.className=`moderation-item moderation-item--${e.type}`,C.dataset.itemId=e.id,C.dataset.itemStatus=e.status;let b=o(t,C,"article","moderation-item__card"),x=o(t,b,"header","moderation-item__meta");if(o(t,x,"span","moderation-item__type",g[e.type]||e.type),o(t,x,"span","moderation-item__status",h[e.status]||e.status),e.category&&o(t,x,"span","moderation-item__category",(s.categories||{})[e.category]||e.category),e.created_at){let l=o(t,x,"time","moderation-item__time",K(e.created_at,c));l.dateTime=e.created_at}if(e.path){let l=o(t,b,"p","moderation-item__where"),d=o(t,l,"a","",e.title||e.path);e.path.startsWith("/")&&!e.path.startsWith("//")&&(d.href=`${u.replace(/\/+$/,"")}${e.path}${e.section?`#${encodeURIComponent(e.section)}`:""}`)}if((e.author.name||e.author.email)&&o(t,b,"p","moderation-item__author",[e.author.name,e.author.email].filter(Boolean).join(" \xB7 ")),e.parent){let l=o(t,b,"blockquote","moderation-item__context");o(t,l,"p","",`${s.in_reply_to||"In reply to"} ${e.parent.author||""}`.trim()),o(t,l,"p","",e.parent.body)}e.quote&&o(t,b,"blockquote","moderation-item__quote",e.quote),e.reason&&o(t,b,"p","moderation-item__reason",e.reason);let v=o(t,b,"div","moderation-item__body");if(e.body.split(/\n{2,}/).forEach(l=>o(t,v,"p","",l)),e.link){let l=o(t,b,"p","moderation-item__link"),d=o(t,l,"a","",e.link);d.href=e.link,d.rel="noopener"}if(e.history.length>0){let l=o(t,b,"ol","moderation-item__history");e.history.forEach(d=>{let E=[j[d.action]||d.action,d.moderator,d.at?K(d.at,c):"",d.note].filter(Boolean).join(" \xB7 ");o(t,l,"li","",E)})}let A=G(e);if(A.length>0&&_){let l=o(t,b,"div","moderation-item__actions"),d=`moderation-note-${e.id}`,E=o(t,l,"label","moderation-item__note-label",s.note||"Note");E.htmlFor=d;let q=o(t,l,"input","moderation-item__note");q.type="text",q.id=d,q.name="note";let k=null;if(A.includes("resolve")){let m=`moderation-link-${e.id}`,L=o(t,l,"label","moderation-item__note-label",s.link||"Issue, pull request or revision");L.htmlFor=m,k=o(t,l,"input","moderation-item__note"),k.type="url",k.id=m,k.name="link"}let U=o(t,l,"div","moderation-item__buttons");A.forEach(m=>{let L=o(t,U,"button","post-tool",j[m]||m);L.type="button",L.dataset.moderationAction=m,L.addEventListener("click",()=>_(e,m,{note:q.value.trim(),link:k?k.value.trim():""}))})}let S=o(t,b,"p","moderation-item__message");return S.setAttribute("data-item-message",""),S.setAttribute("role","status"),S.hidden=!0,C}function dt(t,e={}){let i=t.ownerDocument,s=i.defaultView,c=s&&s.DatalogDynamicServices||{},u=t.dataset.moderationEndpoint||"",_=e.client||W(B(O({},c),{features:u?{}:c.features,base_url:u||c.base_url||"",credentials:t.dataset.moderationCredentials||"include"})),g=H(),h=st(t,"[data-moderation-labels]"),j=h.errors||{},C=i.documentElement.lang||void 0,b=t.dataset.moderationSite||"",x=t.querySelector("[data-moderation-status]"),v=t.querySelector("[data-moderation-list]"),A=t.querySelector("[data-moderation-filters]"),S=t.querySelector("[data-moderation-more]"),l=t.querySelector("[data-moderation-sign-in]"),d="",E=!1,q=0,k={},U=0,m=(n,a="",y=!1)=>{t.dataset.state=n,t.setAttribute("aria-busy",n==="loading"?"true":"false"),x&&(x.textContent=a,x.hidden=a==="",x.setAttribute("role",y?"alert":"status")),l&&(l.hidden=n!=="unauthorized")},L=()=>{let n={};return A&&new FormData(A).forEach((a,y)=>{n[y]=String(a)}),n},Q=n=>{v.textContent="",S&&(S.hidden=!0),n&&n.kind==="unauthorized"?m("unauthorized",h.unauthorized||"",!0):n&&n.kind==="forbidden"?m("forbidden",h.forbidden||"",!0):n&&it.has(n.kind)?m("disabled",T(n,j)):m("error",T(n,j),!0)},N=(n,a,y=!1)=>{let f=n.querySelector("[data-item-message]");f&&(f.textContent=a,f.hidden=a==="",f.setAttribute("role",y?"alert":"status"))},tt=n=>{let a=r(k.status).trim();return a?a===n.status:(at[n.type]||[]).includes(n.status)},w={root:t,client:_,async load(n=!1,a=n?k:L()){if(E&&n)return null;let y=++q,f=U;E=!0,n||(d=""),m("loading",h.loading||"");try{await _.feature(P);let I=await _.get(`${_.pathFor(P)}/items${lt(a,n?d:"")}`);if(y!==q)return null;if(f!==U)return E=!1,w.load(n,a);k=a;let $=I&&I.data&&typeof I.data=="object"?I.data:{},p=(Array.isArray($.items)?$.items:[]).map(J).filter(Boolean);n||(v.textContent=""),p.forEach(F=>v.appendChild(V(i,F,{labels:h,lang:C,siteUrl:b,onAction:w.act}))),d=r($.next_cursor),S&&(S.hidden=d==="");let D=v.children.length;return m(D>0?"loaded":"empty",D>0?"":h.empty||""),p}catch(I){return y!==q?null:f!==U?(E=!1,w.load(n,a)):(Q(I),null)}finally{y===q&&(E=!1)}},async act(n,a,y={}){let f=Array.from(v.children).find(p=>p.dataset.itemId===n.id);if(!f||!G(n).includes(a))return null;if(a==="resolve"&&!Y.test(y.link||""))return N(f,h.link_required||"",!0),null;let I=Array.from(f.querySelectorAll("button"));I.forEach(p=>{p.disabled=!0}),f.setAttribute("aria-busy","true"),N(f,h.working||"");let $={action:a};y.note&&($.note=y.note),a==="resolve"&&($.link=y.link);try{let p=await _.post(`${_.pathFor(P)}/items/${encodeURIComponent(n.id)}/actions`,$,{idempotencyKey:g.key($,n.id)});g.clear(n.id),U+=1;let F=J(p&&p.data&&p.data.item)||B(O({},n),{status:nt[a]||n.status}),z=Array.from(v.children).find(R=>R.dataset.itemId===n.id);if(!z)return F;let M=(h.done||"{{action}}").split("{{action}}").join((h.actions||{})[a]||a);if(tt(F)){let R=V(i,F,{labels:h,lang:C,siteUrl:b,onAction:w.act});v.replaceChild(R,z),N(R,M)}else z.remove(),m(v.children.length>0?"loaded":"empty",v.children.length>0?M:`${M} ${h.empty||""}`.trim());return F}catch(p){return p&&rt.has(p.kind)?Q(p):(f.setAttribute("aria-busy","false"),I.forEach(D=>{D.disabled=!1}),N(f,T(p,j),!0)),null}}};return A&&(A.addEventListener("submit",n=>{n.preventDefault(),w.load()}),A.addEventListener("reset",()=>{Promise.resolve().then(()=>w.load())})),S&&S.addEventListener("click",()=>w.load(!0)),_.enabled?(w.load(),w):(m("disabled",j.disabled||""),w)}function X(t=document){return Array.from(t.querySelectorAll("[data-moderation-inbox]")).map(e=>dt(e))}function Z(){X(document)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z,{once:!0}):Z();
|
data/assets/js/dist/sources.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"assets/js/academic.js": "c4a510fe7457b70273361e0dec773299604d17c2fbd43eab62a78dd9ff2175da",
|
|
4
4
|
"assets/js/analytics-dashboard.js": "98458c96b2f93c4842a3c4c4197cbcc6e1ebc84f74b322e1935408d3d0d8a3ae",
|
|
5
5
|
"assets/js/comments.js": "5710a30b20bdffa02b256ec9f9e6b07f0871fa5903eb5b60880aba6e915956f5",
|
|
6
|
-
"assets/js/comments/thread.js": "
|
|
6
|
+
"assets/js/comments/thread.js": "50684540ae6f03555ed375df46116f9f91c0c756477a2426972274ec581f18bc",
|
|
7
7
|
"assets/js/contact.js": "7b93f9f5d8f3c0852303ea22c970845072935de50fd6f765087825e60b845c69",
|
|
8
8
|
"assets/js/contact/form.js": "502c755ee72b7f6d050cd3965c25c4979586c1e5c444dd944a77767925c8c5ae",
|
|
9
9
|
"assets/js/core/copy-buttons.js": "339e890158e3c9e5b06f85c56f8658b352a15df8c955e1208dbfa8a75443a55e",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"assets/js/main.js": "3f613ee824f48b83f9065f087bc8e1a75f0368e37a23dacf3196c2b9ffcd38ad",
|
|
23
23
|
"assets/js/math.js": "267693a35a1b9cbf3a9c5475fdaadf3eac5b715bd60af0761b4c0adf0eaf521a",
|
|
24
24
|
"assets/js/moderation.js": "2e9bcb00f0dcf4dd436458d99764989c9728794716dd33c59310d65206323c46",
|
|
25
|
-
"assets/js/moderation/inbox.js": "
|
|
25
|
+
"assets/js/moderation/inbox.js": "ddbe3f4c251ff4bf10bd799fbd2e43777d3d728643fd5b962dfdf258c7365993",
|
|
26
26
|
"assets/js/notebook.js": "361f716a76b398aeb564ef05ba026018b1bc083de28d75c9b8df5776a6ccb21a",
|
|
27
27
|
"assets/js/reactions.js": "8386cffaacba9a1f976274f8145b95e9c1c2409da977dfc94ca195477971848b",
|
|
28
28
|
"assets/js/reactions/widget.js": "8407a55582e017fc9652cf2968db084c06e63e116150abf11c4eac9b7ef90596",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"assets/js/search/utils.js": "a805c21d30ce0d02007609d510c43e99cbb53681ed37b77dd0755af4ccb39e08",
|
|
43
43
|
"assets/js/subscriptions.js": "053b8387521deb5d4f940ef9effc816bc7e754e351460bda098cccd112d0b0c3",
|
|
44
44
|
"assets/js/subscriptions/form.js": "8eee3b658940140bdada2648daae37f11261e38a5a896e863771b12586030898",
|
|
45
|
-
"assets/js/subscriptions/manage.js": "
|
|
45
|
+
"assets/js/subscriptions/manage.js": "4948505dacad370caaccfac389e8721a02f3755d50bdbf54dffafb4e44e1932d",
|
|
46
46
|
"assets/js/visualizations.js": "a0414ea4ec2fd0829d049642420d753529c331966958c298901bff46d8cc26d4",
|
|
47
47
|
"assets/js/webmentions.js": "f36402477bf0e6bd835e3ccf3a0fb67eb3af590ef6da179613eab10409e79803",
|
|
48
48
|
"assets/js/webmentions/list.js": "64dfbad25539d4ae2571bcd61c24a869520c1ec3c1a191b22d4984f1e88c21cf",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b as R,c as q,d as T,e as I}from"./chunks/chunk-WIRUK3OZ.js";import{a as x,c as C}from"./chunks/chunk-VZ5WKQVA.js";import"./chunks/chunk-PATLC23F.js";var h="subscriptions",M=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function N(e,a){let s=e.querySelector(a);if(!s)return{};try{return JSON.parse(s.textContent)||{}}catch(
|
|
1
|
+
import{a as O,b as R,c as q,d as T,e as I}from"./chunks/chunk-WIRUK3OZ.js";import{a as x,c as C}from"./chunks/chunk-VZ5WKQVA.js";import"./chunks/chunk-PATLC23F.js";var h="subscriptions",M=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function N(e,a){let s=e.querySelector(a);if(!s)return{};try{return JSON.parse(s.textContent)||{}}catch(n){return{}}}function $(e,a={}){let s={email:e.email||""};return a.hasTopics&&(s.topics=[].concat(e.topics||[]).filter(Boolean)),a.sourceUrl&&(s.source_url=a.sourceUrl),a.locale&&(s.locale=a.locale),s}function j(e,a,s={}){let n={};return M.test(e.email)||(n.email=s.email_invalid||"That does not look like an email address."),Array.isArray(e.topics)&&e.topics.length===0&&(n.topics=s.topics_required||"Pick at least one."),a.website&&(n.website="spam"),Object.keys(n).length>0?n:null}function P(e,a={}){let s=a.client||C(),n=e.querySelector("form"),c=N(e,"[data-subscribe-labels]"),g=c.errors||{},S=e.ownerDocument,o=S.querySelector('link[rel="canonical"]'),k={sourceUrl:e.dataset.subscribeSource||o&&o.href||"",locale:e.dataset.subscribeLocale||S.documentElement.lang||"",hasTopics:n.querySelector('[name="topics"]')!==null},v=e.dataset.subscribeDoubleOptIn!=="false",E=O(n),w=d=>{n.dataset.result=d,q(n,"success",c[d]||"")};if(!s.enabled)return q(n,"disabled",g.disabled||""),{form:n,available:!1,submit:async()=>null};let m=R(s,h,n,g);n.addEventListener("focusin",()=>m().catch(()=>{}),{once:!0});let p={form:n,available:!0,async submit(){let d=T(n),f=$(d,k),l=j(f,d,c);if(delete n.dataset.result,l)return l.website?(w("pending"),null):(q(n,"invalid",g.invalid||"",l),null);q(n,"pending",c.sending||"");try{await m()}catch(i){return null}try{let i=await s.post(s.pathFor(h),f,{idempotencyKey:E.key(f)}),u=i&&i.data&&typeof i.data.status=="string"?i.data.status:"";return E.clear(),n.reset(),w(u==="confirmed"||u==="subscribed"||u===""&&!v?"confirmed":"pending"),i}catch(i){return i&&i.kind==="conflict"?w("duplicate"):I(n,i,g),null}}};return n.addEventListener("submit",d=>{d.preventDefault(),p.submit()}),p}function U(e=document){return Array.from(e.querySelectorAll("[data-subscribe]")).map(a=>P(a))}var J=["confirm","unsubscribe","manage"],K=/^[A-Za-z0-9._~-]{8,512}$/;function z(e,a){let s=e.querySelector(a);if(!s)return{};try{return JSON.parse(s.textContent)||{}}catch(n){return{}}}function B(e){let a=new URLSearchParams(e||""),s=J.find(c=>a.has(c));if(!s)return null;let n=(a.get(s)||"").trim();return K.test(n)?{action:s,token:n}:null}function V(e,a={}){let s=e.ownerDocument,n=s.defaultView,c=a.client||C(),g=a.location||n&&n.location||{search:"",pathname:"/"},S=a.history===void 0?n&&n.history:a.history,o=z(e,"[data-manage-labels]"),k=o.errors||{},v=e.querySelector("[data-manage-status]"),E=e.querySelector("[data-manage-idle]"),w=e.querySelector("[data-manage-unsubscribe-panel]"),m=e.querySelector("[data-manage-preferences]"),p=B(g.search),d=p?`${c.pathFor(h)}/${encodeURIComponent(p.token)}`:"",f=null,l=s.createElement("button");l.type="button",l.className="post-tool",l.dataset.manageRetry="",l.textContent=o.retry||"Try again",l.hidden=!0,l.addEventListener("click",()=>f==null?void 0:f()),e.appendChild(l);let i=(r,t="",A=!1)=>{r!=="error"&&(f=null),e.dataset.state=r,l.hidden=r!=="error"||!f,v&&(v.textContent=t,v.hidden=t==="",v.setAttribute("role",A?"alert":"status"))},u=r=>{[E,w,m].forEach(t=>{t&&(t.hidden=t!==r)})},F=(r,t,A)=>{let L=t&&r&&(r.kind==="not_found"||r.status===410);f=r!=null&&r.retryable?A:null,u(null),i("error",L?o.invalid_link||"":x(r,k),!0)},y=r=>{e.setAttribute("aria-busy",r?"true":"false"),e.querySelectorAll("button").forEach(t=>{t.disabled=r})},b={root:e,request:p,async confirm(){let r=!1;y(!0),u(null),i("pending",o.confirming||"");try{await c.feature(h),r=!0;let t=await c.post(`${c.pathFor(h)}/confirm`,{token:p.token});return i("confirmed",o.confirmed||""),t}catch(t){return F(t,r,()=>b.confirm()),null}finally{y(!1)}},async unsubscribe(){let r=!1;y(!0),i("pending",o.unsubscribing||"");try{await c.feature(h),r=!0;let t=await c.delete(d);return u(null),i("unsubscribed",o.unsubscribed||""),t}catch(t){return F(t,r,()=>b.unsubscribe()),null}finally{y(!1)}},async load(){let r=!1;y(!0),u(null),i("loading",o.loading||"");try{await c.feature(h),r=!0;let t=await c.get(d),A=t&&t.data&&Array.isArray(t.data.topics)?t.data.topics.map(String):[];return m&&m.querySelectorAll('[name="topics"]').forEach(L=>{L.checked=A.includes(L.value)}),u(m),i("loaded"),A}catch(t){return F(t,r,()=>b.load()),null}finally{y(!1)}},async save(){let r=Array.from(m.querySelectorAll('[name="topics"]:checked')).map(t=>t.value);y(!0),i("pending",o.saving||"");try{let t=await c.patch(d,{topics:r});return i("saved",o.saved||""),t}catch(t){return f=t!=null&&t.retryable?()=>b.save():null,i("error",x(t,k),!0),null}finally{y(!1)}}};return e.querySelectorAll("[data-manage-unsubscribe]").forEach(r=>{r.addEventListener("click",()=>b.unsubscribe())}),m&&m.addEventListener("submit",r=>{r.preventDefault(),b.save()}),c.enabled?p?(S&&typeof S.replaceState=="function"&&S.replaceState(null,"",g.pathname),p.action==="confirm"?b.confirm():p.action==="manage"?b.load():(u(w),i("idle")),b):(u(E),i("idle"),b):(u(null),i("disabled",k.disabled||""),b)}function D(e=document){return Array.from(e.querySelectorAll("[data-subscription-manage]")).map(a=>V(a))}function _(){U(document),D(document)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_,{once:!0}):_();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Datalog
|
|
4
4
|
module Theme
|
|
5
|
-
VERSION = "0.9.
|
|
5
|
+
VERSION = "0.9.2" unless const_defined?(:VERSION)
|
|
6
6
|
# The Ruby the gem installs on, for the gemspec and `datalog check`. The
|
|
7
7
|
# release workflow rewrites every quoted version assigned to a name ending
|
|
8
8
|
# in VERSION in this file, so this name must not end that way.
|