@selenite/commons

This package provides a set of frequently used utilities, types and svelte actions for building projects with Typescript and Svelte.

It is part of the Selenite initiative.

Be careful that some of the functions use WASM code from an associated package : selenite-commons-rs. Therefore, if you use tools like Vite or Rollup, you need to add a plugin to the configuration.

An example of such a plugin is : https://github.com/nshen/vite-plugin-wasm-pack. It is used like this :

// vite.config.ts
import wasmPack from 'vite-plugin-wasm-pack'
export default defineConfig({
plugins: [
wasmPack([], ['@selenite/commons-rs']),
...

References

ActionReturn affineFromPoints animationFrame Array ArrayKeys Attribute autofocus autosize BaseModalSettings boxSelection BoxSelectionParams browser Browser buildXml Button camlelcaseize Canvas capitalize capitalizeWords checkbox ChildProps Click ClickDragOptions clickIfDrag clickIfNoDrag ComplexType ComponentModalSettings contextMenu ContextMenu ContextMenuState distance documentListener DocumentParams download downloadJSON Drag DragAxis DragBounds DragBoundsCoords DragEventData draggable draggableItem DragItemOptions DragOptions EventModifier Filter FilterDefinition filterItems findPossibleMergePositions flattenTree focusTrap FocusTrap formatComment Formatter formatXml formatXMLArray getActiveFilters getAlignBetweenOffsets getAlignBottomOffsets getAlignMiddleOffsets getAlignTopOffsets getBounds getBoundsIntersection getBoundsUnion getClosestElement getClosestElementIndex getDistance getElementFromParsedXml getJustifyBetweenOffsets getJustifyCenterOffsets getJustifyLeftOffsets getJustifyRightOffsets getQueriedItems getSharedString getVarsFromFormatString getXmlAttributes gridLines handleFocusLeave horizontalScroll HTML Ids initials Input Inputs isAlphaNumChar isBrowser isComponentModalSettings isForest isIterable isOverflowing isPlural isPromptModalSettings isSingular isSnippetModalSettings Keyboard keyboardNavigation KeyboardShortcut keys Layout LayoutBetweenOptions LayoutOptions LayoutRect lerp localId makeTree MatchHighlighter matchingParts Math Menu Menu_ MenuItem mergeParsedXml Modal ModalButton ModalButtonSettings ModalButtonType modalButtonTypes modalButtonTypeToButton ModalComponent modals ModalSettings newLocalId newUuid OptimizedDiv padBounds ParsedXmlAttribute parsedXmlComment ParsedXmlNode ParsedXmlNodes parseXml parseXMLArray parseXsd parseXsdFromUrl PartialBy PathGenerator persisted plural pluralize Point PointerDownWatcher Portal posFromClient Position preventDefault Promise PromptModalSettings Queue Rect resizable ResizeHandleParams ResizeSide SaveData Scroll scrollIntoView SearchBar SeleniteLogo shortcut Shortcut ShortcutSettings shortcutToString showContextMenu ShowContextMenu SimpleType singular sleep SnippetModalSettings sortedByIndex splitCamelCase stopPropagation Storage String StringArrayKeys StringKeys Tags takeFocus Textarea titlelize Transform Tree Tree_ TreeComponent unCamelCase uuid uuidv3 uuidv4 uuidv5 Vector2D WindowBounds WindowState words XML XmlSchema XMLTypeName XMLTypeTree XSD

Namespaces

References

Re-exports ActionReturn
Re-exports affineFromPoints
Re-exports animationFrame
Re-exports Array
Re-exports ArrayKeys
Re-exports Attribute
Re-exports autofocus
Re-exports autosize
Re-exports BaseModalSettings
Re-exports boxSelection
Re-exports BoxSelectionParams
Re-exports browser
Renames and re-exports MatchHighlighter
Re-exports buildXml
Renames and re-exports MatchHighlighter
Re-exports camlelcaseize
Re-exports Canvas
Re-exports capitalize
Re-exports capitalizeWords
Re-exports checkbox
Re-exports ChildProps
Re-exports Click
Re-exports ClickDragOptions
Re-exports clickIfDrag
Re-exports clickIfNoDrag
Re-exports ComplexType
Re-exports ComponentModalSettings
Re-exports contextMenu
Renames and re-exports MatchHighlighter
Re-exports ContextMenuState
Re-exports distance
Re-exports documentListener
Re-exports DocumentParams
Re-exports download
Re-exports downloadJSON
Re-exports Drag
Re-exports DragAxis
Re-exports DragBounds
Re-exports DragBoundsCoords
Re-exports DragEventData
Re-exports draggable
Re-exports draggableItem
Re-exports DragItemOptions
Re-exports DragOptions
Re-exports EventModifier
Re-exports Filter
Re-exports FilterDefinition
Re-exports filterItems
Re-exports findPossibleMergePositions
Re-exports flattenTree
Re-exports focusTrap
Re-exports FocusTrap
Re-exports formatComment
Renames and re-exports MatchHighlighter
Re-exports formatXml
Re-exports formatXMLArray
Re-exports getActiveFilters
Re-exports getAlignBetweenOffsets
Re-exports getAlignBottomOffsets
Re-exports getAlignMiddleOffsets
Re-exports getAlignTopOffsets
Re-exports getBounds
Re-exports getBoundsIntersection
Re-exports getBoundsUnion
Re-exports getClosestElement
Re-exports getClosestElementIndex
Re-exports getDistance
Re-exports getElementFromParsedXml
Re-exports getJustifyBetweenOffsets
Re-exports getJustifyCenterOffsets
Re-exports getJustifyLeftOffsets
Re-exports getJustifyRightOffsets
Re-exports getQueriedItems
Re-exports getSharedString
Re-exports getVarsFromFormatString
Re-exports getXmlAttributes
Re-exports gridLines
Re-exports handleFocusLeave
Re-exports horizontalScroll
Re-exports HTML
Re-exports Ids
Re-exports initials
Renames and re-exports MatchHighlighter
Re-exports Inputs
Re-exports isAlphaNumChar
Re-exports isBrowser
Re-exports isComponentModalSettings
Re-exports isForest
Re-exports isIterable
Re-exports isOverflowing
Re-exports isPlural
Re-exports isPromptModalSettings
Re-exports isSingular
Re-exports isSnippetModalSettings
Re-exports Keyboard
Re-exports keyboardNavigation
Re-exports KeyboardShortcut
Re-exports keys
Re-exports Layout
Re-exports LayoutBetweenOptions
Re-exports LayoutOptions
Re-exports LayoutRect
Re-exports lerp
Re-exports localId
Re-exports makeTree
Re-exports MatchHighlighter
Re-exports matchingParts
Re-exports Math
Renames and re-exports MatchHighlighter
Re-exports Menu_
Re-exports MenuItem
Re-exports mergeParsedXml
Re-exports Modal
Re-exports ModalButton
Re-exports ModalButtonSettings
Re-exports ModalButtonType
Re-exports modalButtonTypes
Re-exports modalButtonTypeToButton
Renames and re-exports MatchHighlighter
Re-exports modals
Re-exports ModalSettings
Re-exports newLocalId
Re-exports newUuid
Renames and re-exports MatchHighlighter
Re-exports padBounds
Re-exports ParsedXmlAttribute
Re-exports parsedXmlComment
Re-exports ParsedXmlNode
Re-exports ParsedXmlNodes
Re-exports parseXml
Re-exports parseXMLArray
Re-exports parseXsd
Re-exports parseXsdFromUrl
Re-exports PartialBy
Renames and re-exports MatchHighlighter
Re-exports persisted
Re-exports plural
Re-exports pluralize
Re-exports Point
Re-exports PointerDownWatcher
Re-exports Portal
Re-exports posFromClient
Re-exports Position
Re-exports preventDefault
Re-exports Promise
Re-exports PromptModalSettings
Re-exports Queue
Re-exports Rect
Re-exports resizable
Re-exports ResizeHandleParams
Re-exports ResizeSide
Re-exports SaveData
Re-exports Scroll
Re-exports scrollIntoView
Renames and re-exports MatchHighlighter
Renames and re-exports MatchHighlighter
Re-exports shortcut
Re-exports Shortcut
Re-exports ShortcutSettings
Re-exports shortcutToString
Re-exports showContextMenu
Re-exports ShowContextMenu
Re-exports SimpleType
Re-exports singular
Re-exports sleep
Re-exports SnippetModalSettings
Re-exports sortedByIndex
Re-exports splitCamelCase
Re-exports stopPropagation
Re-exports Storage
Re-exports String
Re-exports StringArrayKeys
Re-exports StringKeys
Renames and re-exports MatchHighlighter
Re-exports takeFocus
Renames and re-exports MatchHighlighter
Re-exports titlelize
Re-exports Transform
Re-exports Tree
Re-exports Tree_
Renames and re-exports MatchHighlighter
Re-exports unCamelCase
Re-exports uuid
Re-exports uuidv3
Re-exports uuidv4
Re-exports uuidv5
Re-exports Vector2D
Re-exports WindowBounds
Re-exports WindowState
Re-exports words
Re-exports XML
Re-exports XmlSchema
Re-exports XMLTypeName
Re-exports XMLTypeTree
Re-exports XSD