@vermeulen.solutions/eventual 0.19.1 → 0.19.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.
- package/README.md +2 -2
- package/astro/events/description.ts +28 -9
- package/dist/index.mjs +1 -1
- package/docs/registry-installation.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://github.com/Vermeulen-Solutions/eventual-rsvp-core/actions/workflows/ci.yml"><img src="https://github.com/Vermeulen-Solutions/eventual-rsvp-core/actions/workflows/ci.yml/badge.svg" alt="CI Status" /></a>
|
|
9
9
|
<a href="https://www.npmjs.com/package/@vermeulen.solutions/eventual"><img src="https://img.shields.io/npm/v/%40vermeulen.solutions%2Feventual?color=176b57&label=npm%20helpers" alt="Latest npm version of the helpers" /></a>
|
|
10
|
-
<a href="https://plugins.emdashcms.com/plugins/@vermeulen.solutions/eventual"><img src="https://img.shields.io/badge/EmDash_Registry-0.19.
|
|
10
|
+
<a href="https://plugins.emdashcms.com/plugins/@vermeulen.solutions/eventual"><img src="https://img.shields.io/badge/EmDash_Registry-0.19.2-0b4d3d" alt="EmDash Plugin Registry" /></a>
|
|
11
11
|
<a href="https://emdashcms.com"><img src="https://img.shields.io/badge/EmDash-1.2%20to%201.6-0b4d3d" alt="EmDash Compatibility" /></a>
|
|
12
12
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-d89521" alt="License: MIT" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/TypeScript-strict-3178c6" alt="TypeScript Strict" />
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
Plan and publish events in [EmDash CMS](https://emdashcms.com). Write announcements, choose venues and organizers, set repeat schedules, and share events through your website and calendar subscriptions.
|
|
20
20
|
|
|
21
|
-
**Current release: 0.19.
|
|
21
|
+
**Current release: 0.19.2**, the same version on the EmDash Registry and on npm. Events are edited in EmDash's own collections, with rich text, images, drafts and translations. Your site builder adds the visitor pages from the package; the screenshots below show them.
|
|
22
22
|
|
|
23
23
|
In 0.14.x, old events stored inside the plugin are shown only when an administrator explicitly enables **Show old events saved inside the plugin**. Native collections remain authoritative. See [what changed](./docs/release-notes-0.14.0.md).
|
|
24
24
|
|
|
@@ -20,16 +20,35 @@ export function descriptionHtml(blocks: unknown[] | undefined, text: string, opt
|
|
|
20
20
|
return Array.isArray(blocks) && blocks.length ? portableTextHtml(blocks, options) : markdownHtml(text, options);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* A plain one-paragraph excerpt for lists and cards. Blocks (paragraphs, headings, list items)
|
|
25
|
+
* are joined as a sentence would be: a colon before a list, semicolons between its items and a
|
|
26
|
+
* full stop after a heading, so "What to bring" and its list do not run together.
|
|
27
|
+
*/
|
|
24
28
|
export function descriptionExcerpt(source: string, limit = 180): string {
|
|
25
|
-
const
|
|
26
|
-
.replace(/<[^>]*>/
|
|
27
|
-
.replace(
|
|
28
|
-
.replace(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const text = source
|
|
30
|
+
.replace(/<li\b[^>]*>/gi, "\n- ")
|
|
31
|
+
.replace(/<br\s*\/?>|<\/(?:p|li|h[1-6]|div|blockquote)>/gi, "\n")
|
|
32
|
+
.replace(/<[^>]*>/g, " ");
|
|
33
|
+
const blocks = text.split(/\n+/).map((line) => ({
|
|
34
|
+
list: /^\s*(?:[-*+]|\d+[.)])\s+/.test(line),
|
|
35
|
+
text: line
|
|
36
|
+
.replace(/^\s*#{1,6}\s+/, "")
|
|
37
|
+
.replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")
|
|
38
|
+
.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
|
|
39
|
+
.replace(/\s*\(https?:\/\/[^\s)]+\)/g, "")
|
|
40
|
+
.replace(/\*\*|__|[*_`]/g, "")
|
|
41
|
+
.replace(/\s+/g, " ")
|
|
42
|
+
.trim(),
|
|
43
|
+
})).filter((block) => block.text);
|
|
44
|
+
let plain = "";
|
|
45
|
+
blocks.forEach((block, index) => {
|
|
46
|
+
plain += block.text;
|
|
47
|
+
const next = blocks[index + 1];
|
|
48
|
+
if (!next) return;
|
|
49
|
+
if (/[.!?…:;,]$/.test(block.text)) plain += " ";
|
|
50
|
+
else plain += block.list && next.list ? "; " : next.list ? ": " : ". ";
|
|
51
|
+
});
|
|
33
52
|
if (plain.length <= limit) return plain;
|
|
34
53
|
const cut = plain.slice(0, limit + 1);
|
|
35
54
|
const boundary = cut.lastIndexOf(" ");
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Eventual RSVP – Core 0.19.
|
|
1
|
+
# Eventual RSVP – Core 0.19.2
|
|
2
2
|
|
|
3
3
|
Requires EmDash **>=1.2.0 <2.0.0**; tested on 1.2.0, 1.4.0, 1.5.0 and 1.6.0. **1.4.0 or newer is recommended** for nested forms and Cloudflare plugin mutations, and required for the optional cache integration.
|
|
4
4
|
|
|
5
|
-
In **Plugins → Registry**, find **Eventual RSVP – Core** by **vermeulen.solutions**, review permissions and install or update. 0.19.
|
|
5
|
+
In **Plugins → Registry**, find **Eventual RSVP – Core** by **vermeulen.solutions**, review permissions and install or update. 0.19.2 needs no new permissions; since 0.18.0 Core uses `network:request` to `cdn.jsdelivr.net` for the admin's language packs. Agent tools stay off until you expand the plugin under **Plugins** and switch on **Agent access**.
|
|
6
6
|
|
|
7
7
|
Open **Event settings**, select compatible event, venue and organizer collections, then **Save settings**. Installation does not create schemas or migrate content. Site builders: [collection setup](https://github.com/Vermeulen-Solutions/eventual-rsvp-core/blob/main/docs/collection-setup.md).
|
|
8
8
|
|