@edifice.io/react 2.6.14-develop-enabling.20261118121708 → 2.6.14-develop-enabling.20261119153719
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/dist/modules/homepage/components/Rss/Rss.js +1 -1
- package/dist/modules/homepage/components/Rss/RssFeedsModal.js +1 -1
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +1 -1
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +1 -1
- package/dist/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js +1 -1
- package/package.json +6 -6
- /package/dist/node_modules/.pnpm/{prosemirror-transform@1.12.6 → prosemirror-transform@1.12.7}/node_modules/prosemirror-transform/dist/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import SvgIconEdit from"../../../icons/components/IconEdit.js";import SvgIconPlus from"../../../icons/components/IconPlus.js";import useDate from"../../../../hooks/useDate/useDate.js";import Image from"../../../../components/Image/Image.js";import ButtonBeta from"../../../../components/ButtonBeta/ButtonBeta.js";import TextSkeleton from"../../../../components/Skeleton/TextSkeleton.js";import HomeCard from"../HomeCard/HomeCard.js";import{htmlToText}from"./utils.js";import clsx$1 from"clsx";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuEmptyArticles from"@edifice.io/bootstrap/dist/images/homepage/illu-rss-empty-articles.svg";import illuError from"@edifice.io/bootstrap/dist/images/homepage/illu-rss-error.svg";import
|
|
1
|
+
import SvgIconEdit from"../../../icons/components/IconEdit.js";import SvgIconPlus from"../../../icons/components/IconPlus.js";import useDate from"../../../../hooks/useDate/useDate.js";import Image from"../../../../components/Image/Image.js";import ButtonBeta from"../../../../components/ButtonBeta/ButtonBeta.js";import TextSkeleton from"../../../../components/Skeleton/TextSkeleton.js";import HomeCard from"../HomeCard/HomeCard.js";import{htmlToText}from"./utils.js";import clsx$1 from"clsx";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuEmptyArticles from"@edifice.io/bootstrap/dist/images/homepage/illu-rss-empty-articles.svg";import illuError from"@edifice.io/bootstrap/dist/images/homepage/illu-rss-error.svg";import illuEmptyFeeds from"@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";var SKELETON_ARTICLES=[0,1,2];function Rss({feeds,isLoading=!1,selectedIndex,onSelectFeed,articles,articlesStatus,onEditClick}){let{t}=useTranslation(),{formatDate}=useDate(),hasFeeds=feeds.length>0;return jsxs(HomeCard,{variant:`primary`,children:[jsxs(`div`,{className:`rss-widget__header`,children:[jsx(`h3`,{className:`rss-widget__title`,children:t(`homepage.widget.rss.title`)}),!isLoading&&(hasFeeds?jsx(ButtonBeta,{type:`button`,variant:`ghost`,color:`tertiary`,leftIcon:jsx(SvgIconEdit,{}),"aria-label":t(`homepage.widget.rss.edit`),"data-testid":`rss-button-edit`,onClick:onEditClick}):jsx(ButtonBeta,{type:`button`,variant:`ghost`,color:`tertiary`,size:`sm`,rightIcon:jsx(SvgIconPlus,{}),"data-testid":`rss-button-add`,onClick:onEditClick,children:t(`homepage.widget.rss.add`)}))]}),jsx(HomeCard.Content,{children:jsxs(`div`,{className:`rss-widget`,children:[!isLoading&&!hasFeeds&&jsxs(`div`,{className:`rss-widget__empty`,children:[jsx(Image,{src:illuEmptyFeeds,alt:``,"aria-hidden":`true`,className:`rss-widget__empty-image`}),jsx(`p`,{className:`rss-widget__state-text`,children:t(`homepage.widget.rss.empty`)})]}),!isLoading&&hasFeeds&&jsx(`div`,{className:`rss-widget__feeds`,role:`group`,"aria-label":t(`homepage.widget.rss.feeds`),children:feeds.map((feed,index)=>jsx(`button`,{type:`button`,className:clsx$1(`rss-widget__chip`,{"rss-widget__chip-active":index===selectedIndex}),"aria-pressed":index===selectedIndex,"data-testid":`rss-button-feed-${index}`,onClick:()=>onSelectFeed(index),children:feed.title},`${feed.link}-${index}`))}),(isLoading||hasFeeds)&&(status=>status===`loading`?jsx(`div`,{className:`rss-widget__articles`,"data-testid":`rss-skeleton`,children:SKELETON_ARTICLES.map(key=>jsxs(`div`,{className:`rss-widget__article`,"aria-hidden":`true`,children:[jsx(TextSkeleton,{className:`rss-widget__skeleton-title`}),jsx(TextSkeleton,{size:`xs`,className:`rss-widget__skeleton-date`}),jsx(TextSkeleton,{size:`sm`}),jsx(TextSkeleton,{size:`sm`})]},key))}):status===`error`?jsxs(`div`,{className:`rss-widget__state`,children:[jsx(`div`,{className:`rss-widget__state-illustration`,children:jsx(Image,{src:illuError,alt:``,"aria-hidden":`true`,className:`rss-widget__error-image`})}),jsx(`p`,{className:`rss-widget__state-text`,children:t(`homepage.widget.rss.error`)})]}):articles.length===0?jsxs(`div`,{className:`rss-widget__state`,children:[jsx(Image,{src:illuEmptyArticles,alt:``,"aria-hidden":`true`,className:`rss-widget__empty-articles-image`}),jsx(`p`,{className:`rss-widget__state-text`,children:t(`homepage.widget.rss.noArticles`)})]}):jsx(`div`,{className:`rss-widget__articles`,children:articles.map((article,index)=>jsxs(`a`,{href:article.link,target:`_blank`,rel:`noopener noreferrer`,className:`rss-widget__article`,"data-testid":`rss-link-article-${index}`,children:[jsx(`span`,{className:`rss-widget__article-title`,children:article.title}),article.pubDate&&jsx(`span`,{className:`rss-widget__article-date`,children:formatDate(new Date(article.pubDate),`dddd D MMMM YYYY`)}),article.description&&jsx(`span`,{className:`rss-widget__article-description`,children:htmlToText(article.description)})]},`${article.link}-${index}`))}))(isLoading?`loading`:articlesStatus)]})})]})}export{Rss};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import SvgIconClose from"../../../icons/components/IconClose.js";import SvgIconEdit from"../../../icons/components/IconEdit.js";import SvgIconPlus from"../../../icons/components/IconPlus.js";import useBreakpoint from"../../../../hooks/useBreakpoint/useBreakpoint.js";import Image from"../../../../components/Image/Image.js";import ButtonBeta from"../../../../components/ButtonBeta/ButtonBeta.js";import ModalBeta from"../../../../components/ModalBeta/ModalBeta.js";import Table from"../../../../components/Table/components/Table.js";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import
|
|
1
|
+
import SvgIconClose from"../../../icons/components/IconClose.js";import SvgIconEdit from"../../../icons/components/IconEdit.js";import SvgIconPlus from"../../../icons/components/IconPlus.js";import useBreakpoint from"../../../../hooks/useBreakpoint/useBreakpoint.js";import Image from"../../../../components/Image/Image.js";import ButtonBeta from"../../../../components/ButtonBeta/ButtonBeta.js";import ModalBeta from"../../../../components/ModalBeta/ModalBeta.js";import Table from"../../../../components/Table/components/Table.js";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuEmptyFeeds from"@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";function RssFeedsModal({isOpen,feeds,canAddFeed,onClose,onAddClick,onEditFeed,onDeleteFeed}){let{t}=useTranslation(),{md}=useBreakpoint(),columnCount=md?3:2;return jsxs(ModalBeta,{id:`rss-feeds-modal`,isOpen,size:`l`,onModalClose:onClose,children:[jsx(ModalBeta.Header,{onModalClose:onClose,children:t(`homepage.widget.rss.modal.title`)}),jsx(ModalBeta.Body,{children:jsx(`div`,{className:`rss-widget-table`,children:jsxs(Table,{children:[jsx(Table.Thead,{children:jsxs(Table.Tr,{children:[jsx(Table.Th,{className:`visually-hidden`,children:t(`homepage.widget.rss.modal.table.name`)}),jsx(Table.Th,{className:`visually-hidden`,children:t(`homepage.widget.rss.modal.table.url`)}),jsx(Table.Th,{className:`visually-hidden`,children:t(`homepage.widget.rss.modal.table.actions`)})]})}),jsxs(Table.Tbody,{children:[jsx(Table.Tr,{className:`rss-widget-table__action-row`,children:jsx(Table.Td,{colSpan:columnCount,children:jsx(`div`,{className:`rss-widget-table__toolbar`,children:jsx(ButtonBeta,{type:`button`,variant:`outline`,leftIcon:jsx(SvgIconPlus,{}),onClick:onAddClick,disabled:!canAddFeed,"data-testid":`rss-button-add-feed`,children:t(`homepage.widget.rss.modal.add`)})})})}),feeds.length===0?jsx(Table.Tr,{className:`rss-widget-table__empty-row`,children:jsx(Table.Td,{colSpan:columnCount,children:jsxs(`div`,{className:`rss-widget-table__empty`,children:[jsx(Image,{src:illuEmptyFeeds,alt:``,"aria-hidden":`true`,className:`rss-widget-table__empty-image`}),jsx(`p`,{className:`rss-widget-table__empty-title`,children:t(`homepage.widget.rss.modal.empty.title`)}),jsx(`p`,{className:`rss-widget-table__empty-text`,children:t(`homepage.widget.rss.empty`)})]})})}):feeds.map((feed,index)=>jsxs(Table.Tr,{"data-testid":`rss-row-${index}`,children:[jsx(Table.Td,{className:`rss-widget-table__name`,children:feed.title}),jsx(Table.Td,{className:`rss-widget-table__url`,children:feed.link}),jsx(Table.Td,{className:`rss-widget-table__actions`,children:jsxs(`div`,{className:`rss-widget-table__actions-buttons`,children:[jsx(ButtonBeta,{type:`button`,variant:`ghost`,color:`tertiary`,size:`sm`,leftIcon:jsx(SvgIconEdit,{}),"aria-label":t(`homepage.widget.rss.modal.table.edit`,{title:feed.title}),"data-testid":`rss-button-edit-${index}`,onClick:()=>onEditFeed(index)}),jsx(ButtonBeta,{type:`button`,variant:`ghost`,color:`tertiary`,size:`sm`,leftIcon:jsx(SvgIconClose,{}),"aria-label":t(`homepage.widget.rss.modal.table.delete`,{title:feed.title}),"data-testid":`rss-button-delete-${index}`,onClick:()=>onDeleteFeed(index)})]})})]},`${feed.link}-${index}`))]})]})})})]})}export{RssFeedsModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import SvgIconEdit from"../../../icons/components/IconEdit.js";import Flex from"../../../../components/Flex/Flex.js";import Image from"../../../../components/Image/Image.js";import LinkPill from"../../../../components/LinkPill/LinkPill.js";import HomeCard from"../HomeCard/HomeCard.js";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import
|
|
1
|
+
import SvgIconEdit from"../../../icons/components/IconEdit.js";import Flex from"../../../../components/Flex/Flex.js";import Image from"../../../../components/Image/Image.js";import LinkPill from"../../../../components/LinkPill/LinkPill.js";import HomeCard from"../HomeCard/HomeCard.js";import{jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuEmptyFeeds from"@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";function UsefulLinks({links,onEditClick}){let{t}=useTranslation();return jsxs(HomeCard,{variant:`primary`,children:[jsx(HomeCard.Header,{title:t(`homepage.usefulLinks.title`),actionLabel:t(`homepage.usefulLinks.edit`),actionLeftIcon:jsx(SvgIconEdit,{}),onActionClick:onEditClick,actionProps:{"data-testid":`usefullinks-button-edit`}}),jsx(HomeCard.Content,{children:links.length===0?jsxs(`div`,{className:`useful-links-widget__empty`,children:[jsx(Image,{src:illuEmptyFeeds,alt:``,"aria-hidden":`true`,style:{width:160,height:87}}),jsx(`p`,{className:`useful-links-widget__empty-text`,children:t(`homepage.usefulLinks.empty`)})]}):jsx(Flex,{direction:`column`,gap:`8`,children:links.map(link=>jsx(LinkPill,{href:link.url,label:link.name,"data-testid":`usefullinks-link-${link.id}`},link.id))})})]})}export{UsefulLinks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import SvgIconClose from"../../../icons/components/IconClose.js";import SvgIconEdit from"../../../icons/components/IconEdit.js";import SvgIconPlus from"../../../icons/components/IconPlus.js";import Flex from"../../../../components/Flex/Flex.js";import useBreakpoint from"../../../../hooks/useBreakpoint/useBreakpoint.js";import Image from"../../../../components/Image/Image.js";import ButtonBeta from"../../../../components/ButtonBeta/ButtonBeta.js";import ModalBeta from"../../../../components/ModalBeta/ModalBeta.js";import Table from"../../../../components/Table/components/Table.js";import{Fragment,jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import
|
|
1
|
+
import SvgIconClose from"../../../icons/components/IconClose.js";import SvgIconEdit from"../../../icons/components/IconEdit.js";import SvgIconPlus from"../../../icons/components/IconPlus.js";import Flex from"../../../../components/Flex/Flex.js";import useBreakpoint from"../../../../hooks/useBreakpoint/useBreakpoint.js";import Image from"../../../../components/Image/Image.js";import ButtonBeta from"../../../../components/ButtonBeta/ButtonBeta.js";import ModalBeta from"../../../../components/ModalBeta/ModalBeta.js";import Table from"../../../../components/Table/components/Table.js";import{Fragment,jsx,jsxs}from"react/jsx-runtime";import{useTranslation}from"react-i18next";import illuEmptyFeeds from"@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";function UsefulLinksModal({isOpen,links,canAddLink,onClose,onAddClick,onEditLink,onDeleteLink}){let{t}=useTranslation(),{md}=useBreakpoint(),addLinkButton=jsx(ButtonBeta,{type:`button`,variant:`outline`,leftIcon:jsx(SvgIconPlus,{}),onClick:onAddClick,disabled:!canAddLink,"data-testid":`usefullinks-button-add`,children:t(`homepage.usefulLinks.modal.add`)});return jsxs(ModalBeta,{id:`useful-links-modal`,isOpen,size:`l`,onModalClose:onClose,children:[jsx(ModalBeta.Header,{onModalClose:onClose,children:t(`homepage.usefulLinks.modal.title`)}),jsx(ModalBeta.Body,{children:links.length===0?jsxs(Fragment,{children:[jsx(Flex,{justify:`end`,className:`mb-16`,children:addLinkButton}),jsxs(`div`,{className:`useful-links-modal__empty`,children:[jsx(Image,{src:illuEmptyFeeds,alt:``,"aria-hidden":`true`,style:{width:200,height:109}}),jsx(`p`,{className:`useful-links-modal__empty-title`,children:t(`homepage.usefulLinks.modal.empty.title`)}),jsx(`p`,{className:`useful-links-modal__empty-text`,children:t(`homepage.usefulLinks.modal.empty.text`)})]})]}):jsx(`div`,{className:`useful-links-table`,children:jsxs(Table,{children:[jsx(Table.Thead,{children:jsxs(Table.Tr,{children:[jsx(Table.Th,{className:`visually-hidden`,children:t(`homepage.usefulLinks.modal.table.name`)}),jsx(Table.Th,{className:`visually-hidden`,children:t(`homepage.usefulLinks.modal.table.url`)}),jsx(Table.Th,{className:`visually-hidden`,children:t(`homepage.usefulLinks.modal.table.actions`)})]})}),jsxs(Table.Tbody,{children:[jsx(Table.Tr,{className:`useful-links-table__action-row`,children:jsx(Table.Td,{colSpan:md?3:2,children:jsx(Flex,{justify:`end`,children:addLinkButton})})}),links.map(link=>jsxs(Table.Tr,{"data-testid":`usefullinks-row-${link.id}`,children:[jsx(Table.Td,{className:`useful-links-table__name`,children:link.name}),jsx(Table.Td,{className:`useful-links-table__url`,children:link.url}),jsx(Table.Td,{className:`useful-links-table__actions`,children:jsxs(Flex,{gap:`4`,justify:`end`,children:[jsx(ButtonBeta,{type:`button`,variant:`ghost`,color:`tertiary`,size:`sm`,leftIcon:jsx(SvgIconEdit,{}),"aria-label":t(`homepage.usefulLinks.modal.table.edit`,{name:link.name}),"data-testid":`usefullinks-button-edit-${link.id}`,onClick:()=>onEditLink(link)}),jsx(ButtonBeta,{type:`button`,variant:`ghost`,color:`tertiary`,size:`sm`,leftIcon:jsx(SvgIconClose,{}),"aria-label":t(`homepage.usefulLinks.modal.table.delete`,{name:link.name}),"data-testid":`usefullinks-button-delete-${link.id}`,onClick:()=>onDeleteLink(link.id)})]})})]},link.id))]})]})})})]})}export{UsefulLinksModal};
|
package/dist/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment,Slice}from"../../../../prosemirror-model@1.25.13/node_modules/prosemirror-model/dist/index.js";import{ReplaceAroundStep,ReplaceStep}from"../../../../prosemirror-transform@1.12.
|
|
1
|
+
import{Fragment,Slice}from"../../../../prosemirror-model@1.25.13/node_modules/prosemirror-model/dist/index.js";import{ReplaceAroundStep,ReplaceStep}from"../../../../prosemirror-transform@1.12.7/node_modules/prosemirror-transform/dist/index.js";var classesById=Object.create(null),Selection=class{constructor($anchor,$head,ranges){this.$anchor=$anchor,this.$head=$head,this.ranges=ranges||[new SelectionRange($anchor.min($head),$anchor.max($head))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let ranges=this.ranges;for(let i=0;i<ranges.length;i++)if(ranges[i].$from.pos!=ranges[i].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(tr,content=Slice.empty){let lastNode=content.content.lastChild,lastParent=null;for(let i=0;i<content.openEnd;i++)lastParent=lastNode,lastNode=lastNode.lastChild;let mapFrom=tr.steps.length,ranges=this.ranges;for(let i=0;i<ranges.length;i++){let{$from,$to}=ranges[i],mapping=tr.mapping.slice(mapFrom);tr.replaceRange(mapping.map($from.pos),mapping.map($to.pos),i?Slice.empty:content),i==0&&selectionToInsertionEnd(tr,mapFrom,(lastNode?lastNode.isInline:lastParent&&lastParent.isTextblock)?-1:1)}}replaceWith(tr,node){let mapFrom=tr.steps.length,ranges=this.ranges;for(let i=0;i<ranges.length;i++){let{$from,$to}=ranges[i],mapping=tr.mapping.slice(mapFrom),from=mapping.map($from.pos),to=mapping.map($to.pos);i?tr.deleteRange(from,to):(tr.replaceRangeWith(from,to,node),selectionToInsertionEnd(tr,mapFrom,node.isInline?-1:1))}}static findFrom($pos,dir,textOnly=!1){let inner=$pos.parent.inlineContent?new TextSelection($pos):findSelectionIn($pos.node(0),$pos.parent,$pos.pos,$pos.index(),dir,textOnly);if(inner)return inner;for(let depth=$pos.depth-1;depth>=0;depth--){let found=dir<0?findSelectionIn($pos.node(0),$pos.node(depth),$pos.before(depth+1),$pos.index(depth),dir,textOnly):findSelectionIn($pos.node(0),$pos.node(depth),$pos.after(depth+1),$pos.index(depth)+1,dir,textOnly);if(found)return found}return null}static near($pos,bias=1){return this.findFrom($pos,bias)||this.findFrom($pos,-bias)||new AllSelection($pos.node(0))}static atStart(doc){return findSelectionIn(doc,doc,0,0,1)||new AllSelection(doc)}static atEnd(doc){return findSelectionIn(doc,doc,doc.content.size,doc.childCount,-1)||new AllSelection(doc)}static fromJSON(doc,json){if(!json||!json.type)throw RangeError(`Invalid input for Selection.fromJSON`);let cls=classesById[json.type];if(!cls)throw RangeError(`No selection type ${json.type} defined`);return cls.fromJSON(doc,json)}static jsonID(id,selectionClass){if(id in classesById)throw RangeError(`Duplicate use of selection JSON ID `+id);return classesById[id]=selectionClass,selectionClass.prototype.jsonID=id,selectionClass}getBookmark(){return TextSelection.between(this.$anchor,this.$head).getBookmark()}};Selection.prototype.visible=!0;var SelectionRange=class{constructor($from,$to){this.$from=$from,this.$to=$to}},warnedAboutTextSelection=!1;function checkTextSelection($pos){!warnedAboutTextSelection&&!$pos.parent.inlineContent&&(warnedAboutTextSelection=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+$pos.parent.type.name+`)`))}var TextSelection=class TextSelection extends Selection{constructor($anchor,$head=$anchor){checkTextSelection($anchor),checkTextSelection($head),super($anchor,$head)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(doc,mapping){let $head=doc.resolve(mapping.map(this.head));if(!$head.parent.inlineContent)return Selection.near($head);let $anchor=doc.resolve(mapping.map(this.anchor));return new TextSelection($anchor.parent.inlineContent?$anchor:$head,$head)}replace(tr,content=Slice.empty){if(super.replace(tr,content),content==Slice.empty){let marks=this.$from.marksAcross(this.$to);marks&&tr.ensureMarks(marks)}}eq(other){return other instanceof TextSelection&&other.anchor==this.anchor&&other.head==this.head}getBookmark(){return new TextBookmark(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(doc,json){if(typeof json.anchor!=`number`||typeof json.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new TextSelection(doc.resolve(json.anchor),doc.resolve(json.head))}static create(doc,anchor,head=anchor){let $anchor=doc.resolve(anchor);return new this($anchor,head==anchor?$anchor:doc.resolve(head))}static between($anchor,$head,bias){let dPos=$anchor.pos-$head.pos;if((!bias||dPos)&&(bias=dPos>=0?1:-1),!$head.parent.inlineContent){let found=Selection.findFrom($head,bias,!0)||Selection.findFrom($head,-bias,!0);if(found)$head=found.$head;else return Selection.near($head,bias)}return $anchor.parent.inlineContent||(dPos==0?$anchor=$head:($anchor=(Selection.findFrom($anchor,-bias,!0)||Selection.findFrom($anchor,bias,!0)).$anchor,$anchor.pos<$head.pos!=dPos<0&&($anchor=$head))),new TextSelection($anchor,$head)}};Selection.jsonID(`text`,TextSelection);var TextBookmark=class TextBookmark{constructor(anchor,head){this.anchor=anchor,this.head=head}map(mapping){return new TextBookmark(mapping.map(this.anchor),mapping.map(this.head))}resolve(doc){return TextSelection.between(doc.resolve(this.anchor),doc.resolve(this.head))}},NodeSelection=class NodeSelection extends Selection{constructor($pos){let node=$pos.nodeAfter,$end=$pos.node(0).resolve($pos.pos+node.nodeSize);super($pos,$end),this.node=node}map(doc,mapping){let{deleted,pos}=mapping.mapResult(this.anchor),$pos=doc.resolve(pos);return deleted?Selection.near($pos):new NodeSelection($pos)}content(){return new Slice(Fragment.from(this.node),0,0)}eq(other){return other instanceof NodeSelection&&other.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new NodeBookmark(this.anchor)}static fromJSON(doc,json){if(typeof json.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new NodeSelection(doc.resolve(json.anchor))}static create(doc,from){return new NodeSelection(doc.resolve(from))}static isSelectable(node){return!node.isText&&node.type.spec.selectable!==!1}};NodeSelection.prototype.visible=!1,Selection.jsonID(`node`,NodeSelection);var NodeBookmark=class NodeBookmark{constructor(anchor){this.anchor=anchor}map(mapping){let{deleted,pos}=mapping.mapResult(this.anchor);return deleted?new TextBookmark(pos,pos):new NodeBookmark(pos)}resolve(doc){let $pos=doc.resolve(this.anchor),node=$pos.nodeAfter;return node&&NodeSelection.isSelectable(node)?new NodeSelection($pos):Selection.near($pos)}},AllSelection=class AllSelection extends Selection{constructor(doc){super(doc.resolve(0),doc.resolve(doc.content.size))}replace(tr,content=Slice.empty){if(content==Slice.empty){tr.delete(0,tr.doc.content.size);let sel=Selection.atStart(tr.doc);sel.eq(tr.selection)||tr.setSelection(sel)}else super.replace(tr,content)}toJSON(){return{type:`all`}}static fromJSON(doc){return new AllSelection(doc)}map(doc){return new AllSelection(doc)}eq(other){return other instanceof AllSelection}getBookmark(){return AllBookmark}};Selection.jsonID(`all`,AllSelection);var AllBookmark={map(){return this},resolve(doc){return new AllSelection(doc)}};function findSelectionIn(doc,node,pos,index,dir,text=!1){if(node.inlineContent)return TextSelection.create(doc,pos);for(let i=index-(dir>0?0:1);dir>0?i<node.childCount:i>=0;i+=dir){let child=node.child(i);if(!child.isAtom){let inner=findSelectionIn(doc,child,pos+dir,dir<0?child.childCount:0,dir,text);if(inner)return inner}else if(!text&&NodeSelection.isSelectable(child))return NodeSelection.create(doc,pos-(dir<0?child.nodeSize:0));pos+=child.nodeSize*dir}return null}function selectionToInsertionEnd(tr,startLen,bias){let last=tr.steps.length-1;if(last<startLen)return;let step=tr.steps[last];if(!(step instanceof ReplaceStep||step instanceof ReplaceAroundStep))return;let map=tr.mapping.maps[last],end;map.forEach((_from,_to,_newFrom,newTo)=>{end??=newTo}),tr.setSelection(Selection.near(tr.doc.resolve(end),bias))}function bind(f,self){return!self||!f?f:f.bind(self)}var FieldDesc=class{constructor(name,desc,self){this.name=name,this.init=bind(desc.init,self),this.apply=bind(desc.apply,self)}};new FieldDesc(`doc`,{init(config){return config.doc||config.schema.topNodeType.createAndFill()},apply(tr){return tr.doc}}),new FieldDesc(`selection`,{init(config,instance){return config.selection||Selection.atStart(instance.doc)},apply(tr){return tr.selection}}),new FieldDesc(`storedMarks`,{init(config){return config.storedMarks||null},apply(tr,_marks,_old,state){return state.selection.$cursor?tr.storedMarks:null}}),new FieldDesc(`scrollToSelection`,{init(){return 0},apply(tr,prev){return tr.scrolledIntoView?prev+1:prev}});function bindProps(obj,self,target){for(let prop in obj){let val=obj[prop];val instanceof Function?val=val.bind(self):prop==`handleDOMEvents`&&(val=bindProps(val,self,{})),target[prop]=val}return target}var Plugin=class{constructor(spec){this.spec=spec,this.props={},spec.props&&bindProps(spec.props,this,this.props),this.key=spec.key?spec.key.key:createKey(`plugin`)}getState(state){return state[this.key]}},keys=Object.create(null);function createKey(name){return name in keys?name+`$`+ ++keys[name]:(keys[name]=0,name+`$`)}var PluginKey=class{constructor(name=`key`){this.key=createKey(name)}get(state){return state.config.pluginsByKey[this.key]}getState(state){return state[this.key]}};export{Plugin,PluginKey};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.14-develop-enabling.
|
|
3
|
+
"version": "2.6.14-develop-enabling.20261119153719",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -134,9 +134,9 @@
|
|
|
134
134
|
"swiper": "10.1.0",
|
|
135
135
|
"ua-parser-js": "1.0.36",
|
|
136
136
|
"zustand": "4.5.7",
|
|
137
|
-
"@edifice.io/
|
|
138
|
-
"@edifice.io/utilities": "2.6.14-develop-enabling.
|
|
139
|
-
"@edifice.io/
|
|
137
|
+
"@edifice.io/tiptap-extensions": "2.6.14-develop-enabling.20261119153719",
|
|
138
|
+
"@edifice.io/utilities": "2.6.14-develop-enabling.20261119153719",
|
|
139
|
+
"@edifice.io/bootstrap": "2.6.14-develop-enabling.20261119153719"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
142
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"typescript-eslint": "8.54.0",
|
|
167
167
|
"vite": "8.0.14",
|
|
168
168
|
"vite-plugin-dts": "4.5.4",
|
|
169
|
-
"@edifice.io/
|
|
170
|
-
"@edifice.io/
|
|
169
|
+
"@edifice.io/config": "2.6.14-develop-enabling.20261119153719",
|
|
170
|
+
"@edifice.io/client": "2.6.14-develop-enabling.20261119153719"
|
|
171
171
|
},
|
|
172
172
|
"peerDependencies": {
|
|
173
173
|
"@react-spring/web": "9.7.5",
|