### Clone and Run Markwhen Locally Source: https://github.com/mark-when/markwhen/blob/main/README.md Clones the Markwhen repository, installs dependencies, and starts the local development server. This is the primary method for local development. ```shell > git clone git@github.com:mark-when/markwhen.git > cd markwhen > npm i > npm run dev ``` -------------------------------- ### Determine Content Size (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Determines the size of the content from a URL. It first attempts to use a HEAD request to get the 'Content-Length' header. If that fails or is not available, it falls back to fetching the entire content. ```javascript async function Rc(a,c,i){if(a.preventHeadRequest)await i(a,a.options);else{const f=(await c("HEAD",a,yt(a))).headers.get("Content-Length");f?a.size=Number(f):await i(a,a.options)}} ``` -------------------------------- ### Initializing the Report Viewer Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html This function is called when the window loads. It initializes the `jX` class to load the Playwright report data and then renders the main report viewer component `qX` into the DOM element with the ID 'root'. ```javascript FX=()=>{const[e,t]=me.useState();return me.useEffect(()=>{if(e)return;const n=new jX;n.load().then(()=>t(n))},[e]),I(qX,{report:e})};window.onload=()=>{Bi.render(I(FX,{}),document.querySelector("#root"))}; ``` -------------------------------- ### Get React Component Type Name (Advanced) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html This function provides a comprehensive way to get the name of a React component's type, covering various internal tags and element types. It aims to return a human-readable string representation for debugging and identification. ```javascript function Ah(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+'.Consumer';case 10:return(t._context.displayName||"Context")+'.Provider';case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||""!==""?"ForwardRef("+e+")":"ForwardRef";case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qi(t);case 8:return t===Ol?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==="function")return t.displayName||t.name||null;if(typeof t==="string")return t}return null} ``` -------------------------------- ### Get MIME Type for Octet Stream Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html A function that returns the MIME type 'application/octet-stream', typically used for generic binary data. ```javascript n.getMimeType=function(){ return "application/octet-stream" } ``` -------------------------------- ### Control UI Panels in Markwhen Source: https://context7.com/mark-when/markwhen/llms.txt This snippet illustrates how to manage the visibility, sizing, and ordering of UI panels, such as the visualization and detail views, using the panel store. It covers registering panel elements, controlling visibility, setting panel width, and retrieving panel states. Dependencies include `@/(Panels)/panelStore` and Vue's `ref`. ```typescript import { usePanelStore, PanelVisualization, PanelDetail } from "@/Panels/panelStore"; import { ref } from "vue"; const panelStore = usePanelStore(); // Register panel elements (typically in Vue component onMounted) const visualizationElement = ref(); const detailElement = ref(); // Register elements with store if (visualizationElement.value) { panelStore.setPanelElement(PanelVisualization, visualizationElement.value); } if (detailElement.value) { panelStore.setPanelElement(PanelDetail, detailElement.value); } // Control panel visibility panelStore.setVisibility(PanelDetail, true); // Show detail panel panelStore.setVisibility(PanelDetail, false); // Hide detail panel // Set panel width (detail panel only) panelStore.setWidth(PanelDetail, 300); // 300px width // Get panel state const detailState = panelStore.detailPanelState; console.log("Detail panel:", { order: detailState.order, visible: detailState.visible, width: detailState.width, translation: detailState.translation }); const vizState = panelStore.visualizationPanelState; console.log("Visualization panel:", vizState); // Check if panels are being moved if (panelStore.isMoving) { console.log("User is reordering panels"); } // Panel configuration persists to localStorage automatically // and is restored on next load ``` -------------------------------- ### CRC32 Calculation (Markwhen) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Implements CRC32 calculation. It includes a precomputed lookup table for efficiency and methods to append data and get the final CRC value. ```javascript const Ao=4294967295,Nc=33639248,Tc=101075792,Lc=\[\];for(let a=0;a<256;a++){let c=a;for(let i=0;i<8;i++)1&c?c=c>>>1^3988292384:c>>>=1;Lc[a]=c}class xr{constructor(c){this.crc=c||-1}append(c){let i=0|this.crc;for(let f=0,v=0|c.length;f>>8^Lc[255&(i^c[f])];this.crc=i}get(){return~this.crc}} ``` -------------------------------- ### Build and Run Markwhen with Docker Source: https://github.com/mark-when/markwhen/blob/main/README.md Builds a Docker image for Markwhen and runs it on port 8080. This provides a containerized environment for the application. ```shell > git clone git@github.com:mark-when/markwhen.git > cd markwhen > docker build -t markwhen . > docker run -p8080:8080 markwhen ``` -------------------------------- ### SHA-1 Hashing Algorithm Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Implements the SHA-1 cryptographic hash function. It supports updating the hash with data and finalizing to get the resulting hash. Includes helper methods for bitwise operations and block processing. ```javascript const Pc={sha1:function(a){a?(this._h=a._h.slice(0),this._buffer=a._buffer.slice(0),this._length=a._length):this.reset()}};Pc.sha1.prototype={blockSize:512,reset:function(){const a=this;return a._h=this._init.slice(0),a._buffer=\[],a._length=0,a},update:function(a){const c=this;typeof a=="string"&&(a=Bc.utf8String.toBits(a));const i=c._buffer=Ze.concat(c._buffer,a),f=c._length,v=c._length=f+Ze.bitLength(a);if(v>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const A=new Uint32Array(i);let E=0;for(let R=c.blockSize+f-(c.blockSize+f&c.blockSize-1);R<=v;R+=c.blockSize)c._block(A.subarray(16*E,16*(E+1))),E+=1;return i.splice(0,16*E),c},finalize:function(){const a=this;let c=a._buffer;const i=a._h;c=Ze.concat(c,[Ze.partial(1,1)]);for(let f=c.length+2;15&f;f++)c.push(0);for(c.push(Math.floor(a._length/4294967296)),c.push(0|a._length);c.length;)a._block(c.splice(0,16));return a.reset(),i},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(a,c,i,f){return a<=19?c&i|~c&f:a<=39?c^i^f:a<=59?c&i|c&f|i&f:a<=79?c^i^f:void 0},_S:function(a,c){return c<>>32-a},_block:function(a){const c=this,i=c._h,f=Array(80);for(let N=0;N<16;N++)f[N]=a[N];let v=i[0],A=i[1],E=i[2],R=i[3],H=i[4];for(let N=0;N<=79;N++){N>=16&&(f[N]=c._S(1,f[N-3]^f[N-8]^f[N-14]^f[N-16]));const q=c._S(5,v)+c._f(N,A,E,R)+H+f[N]+c._key[Math.floor(N/20)]|0;H=R,R=E,E=c._S(30,A),A=v,v=q}i[0]=i[0]+v|0,i[1]=i[1]+A|0,i[2]=i[2]+E|0,i[3]=i[3]+R|0,i[4]=i[4]+H|0}}} ``` -------------------------------- ### Run Timeline View Locally Source: https://github.com/mark-when/markwhen/blob/main/README.md Optionally clones and runs the Markwhen timeline view locally. This allows for local testing and development of the timeline component. ```shell > git clone git@github.com:mark-when/timeline.git > cd timeline > npm i > npm run dev ``` -------------------------------- ### Search and Navigate Events with Jump Store (TypeScript) Source: https://context7.com/mark-when/markwhen/llms.txt The jump store provides search functionality and navigation between search results, integrating with lunr.js for full-text search. It allows showing/hiding a dialog, performing searches (textual or date-based), navigating results, and checking the type of search results. It depends on the Markwhen store for timeline data and uses natural language date parsing. ```typescript import { useJumpStore } from "@/Jump/jumpStore"; import { useMarkwhenStore } from "@/Markwhen/markwhenStore"; const jumpStore = useJumpStore(); const markwhenStore = useMarkwhenStore(); // Set up timeline markwhenStore.setRawTimelineString(` title: Project Tasks 2024-01-15: Database migration #backend 2024-02-01: UI redesign #frontend 2024-03-10: API endpoints #backend `); // Show jump dialog jumpStore.setShowJumpDialog(true); // Search for events jumpStore.search("backend"); console.log("Search results:", jumpStore.jumpResult); // Navigate through results console.log("Selected index:", jumpStore.selectedIndex); // 0 jumpStore.selectNextIndex(); console.log("Selected index:", jumpStore.selectedIndex); // 1 jumpStore.selectPrevIndex(); console.log("Selected index:", jumpStore.selectedIndex); // 0 // Search by date (uses chrono-node parser) jumpStore.search("January 2024"); // Returns ParseResult with dateRange and scale jumpStore.search("last week"); // Natural language date parsing // Clear search jumpStore.search(undefined); // Hide dialog jumpStore.setShowJumpDialog(false); // Check result type import { isParseResult } from "@/Jump/jumpStore"; const results = jumpStore.jumpResult || []; results.forEach(result => { if (isParseResult(result)) { console.log("Date result:", result.dateRange); } else { console.log("Search result:", result.ref, result.score); } }); ``` -------------------------------- ### Initialize Network Request Source (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Asynchronously initializes a data source by making a network request. It checks for range header support and determines the content size, either from the 'Content-Range' header or by fetching the entire content if range requests are not supported or forced. ```javascript async function An(a,c,i){if(function(f){if(typeof document<"u"){const v=document.createElement("a");return v.href=f,v.protocol=="http:"||v.protocol=="https:"}return/^https?:\\/\\\/i.test(f)}(a.url)&&(a.useRangeHeader||a.forceRangeRequests)){const f=await c(Er,a,Un(a));if(!a.forceRangeRequests&&f.headers.get("Accept-Ranges")!=kr)throw new Error(Ht);{let v;const A=f.headers.get("Content-Range");if(A){const E=A.trim().split(/\\s\\*\/\\s*/);if(E.length){const R=E[1];R&&R!="*"&&(v=Number(R))}}v===void 0?await Rc(a,c,i):a.size=v}}else await Rc(a,c,i)} ``` -------------------------------- ### Get Display Name of React Component Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html This function retrieves the display name or internal name of a React component based on its type and tag. It handles various component types like Lazy, Suspense, and different function component variations. ```javascript function yh(e){switch(e.tag){case 5:return Or(e.type);case 16:return Or("Lazy");case 13:return Or("Suspense");case 19:return Or("SuspenseList");case 0:case 2:case 15:return e=ui(e.type,!1),e;case 11:return e=ui(e.type.render,!1),e;case 1:return e=ui(e.type,!0),e;default:return""}} ``` -------------------------------- ### Manage Event Details in Markwhen Source: https://context7.com/mark-when/markwhen/llms.txt This snippet demonstrates how to use the event detail store to manage the currently displayed event in the detail panel. It covers setting the raw timeline string, setting and clearing the detail event path, and observing changes. Dependencies include `@/(EventDetail)/eventDetailStore` and `@/(Markwhen)/markwhenStore`. ```typescript import { useEventDetailStore } from "@/EventDetail/eventDetailStore"; import { useMarkwhenStore } from "@/Markwhen/markwhenStore"; const eventDetailStore = useEventDetailStore(); const markwhenStore = useMarkwhenStore(); // Set up timeline markwhenStore.setRawTimelineString(` title: Milestones 2024-01: Project kickoff Additional details about kickoff - [ ] Task 1 - [ ] Task 2 2024-06: Final release `); // Set detail event by path const eventPath = { type: "page" as const, path: [0] // First event }; eventDetailStore.setDetailEventPath(eventPath); console.log("Showing details for event at:", eventPath); // Check current detail path const currentDetailPath = eventDetailStore.detailEventPath; if (currentDetailPath) { console.log("Detail path type:", currentDetailPath.type); console.log("Detail path indices:", currentDetailPath.path); } // Clear detail view eventDetailStore.clearDetailEventPath(); console.log("Detail cleared:", eventDetailStore.detailEventPath); // undefined // In a Vue component, you can watch for changes: // import { watch } from "vue"; // watch(() => eventDetailStore.detailEventPath, (path) => { // if (path) { // // Load and display event details // } else { // // Hide detail panel // } // }); ``` -------------------------------- ### React Fiber Reconciliation Path Traversal Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html The `Rh` function is a complex utility for reconciling two React fiber trees (current and alternate). It traverses up and down the trees, comparing nodes and identifying differences to guide the update process. It ensures consistency between the two trees. ```javascript function Rh(e){var t=e.alternate;if(!t){if(t=zn(e),t===null)throw Error(z(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return Ca(o),e;if(s===r)return Ca(o),t;s=s.sibling}throw Error(z(188))}if(n.return!==r.return)n=o,r=s;else{for(var l=!1,u=o.child;u;){if(u===n){l=!0,n=o,r=s;break}if(u===r){l=!0,r=o,n=s;break}u=u.sibling}if(!l){for(u=s.child;u;){if(u===n){l=!0,n=s,r=o;break}if(u===r){l=!0,r=s,n=o;break}u=u.sibling}if(!l)throw Error(z(189))}}}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?e:t} ``` -------------------------------- ### JavaScript Inflate Initialization and Reset Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html This snippet details the initialization and reset functions for the inflate process in JavaScript. 'inflateInit' sets up the inflation context with a specified window size, while 'inflateEnd' cleans up resources. 'reset' is used internally to prepare the state for inflation. ```javascript function inflateInit(i, f) { return i.msg = null, a.blocks = null, f < 8 || f > 15 ? (a.inflateEnd(i), -2) : (a.wbits = f, i.istate.blocks = new y(i, 1 << f), c(i), 0) } function reset(m, null) { i.window.set(m.subarray(D, D + p), 0), i.read = i.write = p } function c(i) { return i && i.istate ? (i.total_in = i.total_out = 0, i.msg = null, i.istate.mode = 7, i.istate.blocks.reset(i, null), 0) : -2 } ``` -------------------------------- ### Track and Update Controlled Input Values (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html This JavaScript snippet defines functions to track and update the values of controlled input elements in React. It includes mechanisms to get the current value and set a new value, ensuring synchronization between the React state and the DOM element. ```javascript function Ju(e){var t=Ju(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get==="function"&&typeof n.set==="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,s.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Io(e){e._valueTracker||(e._valueTracker=Eh(e))}function Zu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ju(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1} ``` -------------------------------- ### Readable Data Source with Size Property (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Extends the base 'qn' class to represent a readable data source where the size is known or can be determined. It inherits the 'initialized' property. ```javascript class Y extends qn{} ``` -------------------------------- ### React Fiber Node Traversal Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html The `ud` and `dd` functions are used to find the first DOM-like (host) or text node within a React fiber tree. `ud` starts from a given fiber node and uses `Rh` to find the corresponding root, while `dd` recursively searches the children. ```javascript function ud(e){return e=Rh(e),e!==null?dd(e):null} function dd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=dd(e);if(t!==null)return t;e=e.sibling}return null} ``` -------------------------------- ### React Scheduler Initialization Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Contains the production-minified version of the React scheduler library. This code is responsible for task scheduling and prioritization within React applications. ```javascript (function(e){ function t(Y,oe){ var ue=Y.length; Y.push(oe); e: for(; 0>>1, Te=Y[Se]; if(0>>1; Se{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerpolicy&&(s.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?s.credentials="include":o.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})(); ``` -------------------------------- ### Navigate Between Timeline Pages with Page Store Source: https://context7.com/mark-when/markwhen/llms.txt The Page store manages the current page index and provides access to page-specific data, including events, metadata, and date ranges. It allows for navigation between different pages within a multi-page timeline and retrieval of page-specific text and tags. This is essential for user interaction and displaying the correct content. ```typescript import { usePageStore } from "@/Markwhen/pageStore"; import { useMarkwhenStore } from "@/Markwhen/markwhenStore"; const pageStore = usePageStore(); const markwhenStore = useMarkwhenStore(); // Set up multi-page timeline const multiPageText = ` title: Page 1 2024-01: Event A === title: Page 2 2024-02: Event B `; markwhenStore.setRawTimelineString(multiPageText); // Navigate to different pages pageStore.setPageIndex(0); console.log(pageStore.pageTimeline.header.title); // "Page 1" pageStore.setPageIndex(1); console.log(pageStore.pageTimeline.header.title); // "Page 2" // Get current page's date range const range = pageStore.pageRange; console.log(`From: ${range.fromDateTime.toISO()}`); console.log(`To: ${range.toDateTime.toISO()}`); // Get page-specific timeline string const pageText = pageStore.pageTimelineString; console.log(`Current page text:\n${pageText}`); // Access page tags const tags = pageStore.tags; Object.keys(tags).forEach(tag => { console.log(`Tag: ${tag}, Color: ${tags[tag]}`); }); ``` -------------------------------- ### Writable Data Sink with Size Tracking (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Extends the base 'qn' class to represent a data sink that can be written to. It tracks the total size of data written to it using the 'writeUint8Array' method. ```javascript class oe extends qn{writeUint8Array(c){this.size+=c.length}} ``` -------------------------------- ### Worker Initialization and Task Management Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html The `ni` function initializes and manages a Web Worker for performing tasks asynchronously. It handles script loading, message passing, and task completion callbacks, supporting initialization, appending, and flushing operations. ```javascript const Kc="init",Jc="append",ti="flush",Pp="message"; let Zc=!0; var ni=(a,c,i,f,v,A,E)=>(Object.assign(a,{busy:!0,codecConstructor:c,options:Object.assign({},i),scripts:E,terminate(){a.worker&&!a.busy&&(a.worker.terminate(),a.interface=null)},onTaskFinished(){a.busy=!1,v(a)}}),A?function(R,H){let N; const q={type:"module"}; if(!R.interface){ if(Zc)try{R.worker=Z({},H.baseURL)}catch{Zc=!1,R.worker=Z(q,H.baseURL)} else R.worker=Z(q,H.baseURL); R.worker.addEventListener(Pp,m,!1),R.interface={append:D=>le({type:Jc,data:D}),flush:()=>le({type:ti}) }} return R.interface; function Z(D,p){let w; try{w=new URL(R.scripts[0],p)}catch{w=R.scripts[0]} return new Worker(w,D) } async function le(D){if(!N){const p=R.options,w=R.scripts.slice(1); await se({scripts:w,type:Kc,options:p,config:{chunkSize:H.chunkSize}}) } return se(D) } function se(D){const p=R.worker,w=new Promise((S,b)=>N={resolve:S,reject:b}); try{ if(D.data)try{D.data=D.data.buffer,p.postMessage(D,[D.data])} catch{p.postMessage(D)} else p.postMessage(D) } catch(S){N.reject(S),N=null,R.onTaskFinished()} return w } function m(D){const p=D.data; if(N){const w=p.error,S=p.type; if(w){const b=new Error(w.message);b.stack=w.stack,N.reject(b),N=null,R.onTaskFinished()} else if(S==Kc||S==ti||S==Jc){const b=p.data; S==ti?(N.resolve({data: ``` -------------------------------- ### Configure Local Timeline View Provider (TypeScript) Source: https://github.com/mark-when/markwhen/blob/main/README.md This snippet demonstrates how to configure the Markwhen view provider to use a local instance of the timeline view instead of the default remote URL. This is useful for self-hosting and local development. It modifies the `url` property within the `useTimelineExternalProvider` function. ```typescript /* src/Views/useViewProviders.ts */ ... export const useTimelineExternalProvider = () => ({ id: "markwhen.timeline", name: "Timeline", - url: "https://timeline.markwhen.com", + url: "http://localhost:5173" ... }) ``` -------------------------------- ### Fetch Entire Content using Fetch API (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Fetches the entire content of a resource using the Fetch API. It processes the response headers to set the data and size properties of the provided object. This is used as a fallback when range requests are not applicable. ```javascript async function En(a){await Dc(a,Ks)}async function Ic(a){await Dc(a,Js)}async function Dc(a,c){const i=await c(Er,a,yt(a));a.data=new Uint8Array(await i.arrayBuffer()),a.size||(a.size=a.data.length)} ``` -------------------------------- ### CRC32 Implementation for Signing Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html The `xr` class is assumed to be a CRC32 implementation used for signing data. It handles appending data and retrieving the final CRC32 checksum. ```javascript class xr { constructor(a) { this.crc = a; } append(a) { for (let i = 0; i < a.length; i++) this.crc = this.crc >>> 8 ^ Cr[(this.crc ^ a[i]) & 255]; } get() { return this.crc; } } ``` -------------------------------- ### Fetch Data from a URL using XHR (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Fetches data from a URL using XMLHttpRequest (XHR). This class is similar to 'Se' but specifically uses XHR for network requests. It also supports range headers and initialization to determine content size. ```javascript class Te extends Y{constructor(c,i){super(),this.url=c,this.preventHeadRequest=i.preventHeadRequest,this.useRangeHeader=i.useRangeHeader,this.forceRangeRequests=i.forceRangeRequests,this.options=i}async init(){super.init(),await An(this,Js,Ic)}async readUint8Array(c,i){return Rt(this,c,i,Js,Ic)}} ``` -------------------------------- ### Render Test Steps Recursively Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Recursively renders test steps, including their title, duration, status, location, and any nested steps or snippets. It handles failed or errored steps distinctly and displays retry counts if applicable. Dependencies include `po` for status rendering and `xc` for duration formatting. ```javascript const Ap = ({ step: e, depth: t }) => I($f, { title: re("span", { children: [ I("span", { style: { float: "right" }, children: xc(e.duration) }), po(e.error || e.duration === -1 ? "failed" : "passed"), I("span", { children: e.title }), e.count > 1 && re(go, { children: [ " ✕ ", I("span", { className: "test-result-counter", children: e.count }) ] }), e.location && re("span", { className: "test-result-path", children: ["— ", e.location.file, ":", e.location.line] }) ] }), loadChildren: e.steps.length + (e.snippet ? 1 : 0) ? () => { const n = e.steps.map((r, o) => I(Ap, { step: r, depth: t + 1 }, o)); return e.snippet && n.unshift(I(Ep, { error: e.snippet }, "line")), n; } : void 0, depth: t }); ``` -------------------------------- ### PBKDF2 Password-Based Key Derivation Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Defines parameters and configurations for the PBKDF2 key derivation function. This includes settings for iterations, hash algorithm, and supported derivation functions. ```javascript Zs="Invalid pasword",Fn=16,Oc={name:"PBKDF2"},Cp=Object.assign({hash:{name:"HMAC"}},Oc),Ip=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Oc),Dp=["deriveBits"],Sr=[8,12,16],Cr=[16,24,32],Kt=10,Hc=[0,0,0,0] ``` -------------------------------- ### Register External Views with Markwhen Source: https://context7.com/mark-when/markwhen/llms.txt This snippet shows how to register external visualization views, like timeline or calendar views, in Markwhen. It covers retrieving all registered providers, logging their details, and configuring a custom provider with properties such as ID, name, URL, and capabilities. Dependencies include `@/(Views)/useViewProviders`. ```typescript import { useViewProviders, useTimelineExternalProvider } from "@/Views/useViewProviders"; // Get all registered view providers const providers = useViewProviders(); console.log(`Registered views: ${providers.length}`); providers.forEach(provider => { console.log(`View: ${provider.name}`); console.log(`ID: ${provider.id}`); console.log(`URL: ${provider.url}`); console.log(`Description: ${provider.description}`); }); // Configure a single provider const timelineProvider = useTimelineExternalProvider(); // Provider configuration structure: const customProvider = { id: "custom.gantt", name: "Gantt Chart", url: "http://localhost:5174", // Local development or production URL iconSvg: `...`, // SVG icon markup settings: [], // View-specific settings capabilities: { edit: true, // Supports editing hoveringEvent: true // Supports hover interactions }, uses: { tags: true, // Uses tag filtering drawerDescription: true, // Shows descriptions in drawer sort: true, // Supports sorting pages: true, // Supports multiple pages jump: true // Supports jump/search }, active: true, description: "A gantt chart view", screenshots: ["/images/gantt.png"] }; // Register custom provider by modifying useViewProviders: // export const useViewProviders = () => { // return [ // useTimelineExternalProvider(), // customProvider // ]; // }; // For local development, change the URL: // In src/Views/useViewProviders.ts: // url: "http://localhost:5173" // Instead of https://timeline.markwhen.com ``` -------------------------------- ### Inflate Fixed Trees - JavaScript Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Sets the parameters for inflating fixed Huffman trees in zlib decompression. This function initializes the code lengths and code counts for the predefined fixed trees. It directly assigns values to output arrays, indicating the structure of the fixed trees. No external dependencies are apparent beyond the zlib internal state. ```javascript P.inflate_trees_fixed=function(a,c,i,f){return a[0]=9,c[0]=5,i[0]=u,f[0]=d,0} ``` -------------------------------- ### Fetch Resource using Fetch API (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Fetches a resource using the Fetch API. This function is a core part of handling network requests, returning a Response object if the request is successful (status < 400). ```javascript async function Ks(a,{options:c,url:i},f){const v=await fetch(i,Object.assign({},c,{method:a,headers:f}));if(v.status<400) ``` -------------------------------- ### Fetch Data from a URL (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Fetches data from a given URL. It handles HTTP requests, including support for range headers to fetch partial content. It can optionally prevent HEAD requests and force range requests. Initialization involves determining the content size. ```javascript class Se extends Y{constructor(c,i){super(),this.url=c,this.preventHeadRequest=i.preventHeadRequest,this.useRangeHeader=i.useRangeHeader,this.forceRangeRequests=i.forceRangeRequests,this.options=Object.assign({},i),delete this.options.preventHeadRequest,delete this.options.useRangeHeader,delete this.options.forceRangeRequests,delete this.options.useXHR}async init(){super.init(),await An(this,Ks,En)}async readUint8Array(c,i){return Rt(this,c,i,Ks,En)}} ``` -------------------------------- ### React Deferred Updates and Transitions (JavaScript) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html This code relates to handling deferred updates and transitions in React. It manages the transition state and priorities, ensuring that less critical updates don't block more important ones, leading to a smoother user experience. ```javascript function dr(){if(ln!==null){var e=md(Is),t=gt.transition,n=ve;try{if(gt.transition=null,ve=16>e?16:e,ln===null)var r=!1;else{if(e=ln,ln=null,Is=0,he&6)throw Error(z(331));var o=he;for(he|=4,J=e.current;J!==null;){var s=J,l=s.child;if(J.flags&16){var u=s.deletions;if(u!==null){for(var d=0;d>>24]),a.keys[2]=~a.crcKey2.get()} function Wc(a){const c=2|a.keys[2];return Gc(Math.imul(c,1^c)>>>8)} function Gc(a){return 255&a} function Yc(a){return 4294967295&a} const Xc="inflate",ei="Invalid signature"; ``` -------------------------------- ### Responsive Chip Component Styles (CSS) Source: https://github.com/mark-when/markwhen/blob/main/playwright-report/index.html Adjusts the styling for chip components on small screens (max-width 600px) to remove rounded corners and borders, making them full-width. This optimizes the display of chips on mobile devices. ```css @media only screen and (max-width: 600px){.chip-header{border-radius:0;border-right:none;border-left:none}.chip-body{border-radius:0;border-right:none;border-left:none;padding:8px}.chip-body-no-insets{padding:0}} ```