Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@craftercms/utils

Package Overview
Dependencies
1
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @craftercms/utils

Crafter CMS utility and helper functions


Version published
Maintainers
3
Install size
122 kB
Created

Changelog

Source

1.2.0

@craftercms/classes

  • SDKService refactored as stand alone functions; no need to use as class now though you may still use in the same way as in previous release if you prefer (backward compatible).

@craftercms/content

  • Services refactored as stand alone functions; no need to use as class now though you may still use in the same way as in previous release if you prefer (backward compatible).
  • New parseDescriptor method which parses a getDescriptor, getItem or GraphQL response into a Content Instance (@see models/Content Instance).

@craftercms/ice

  • First published
  • Publishing generic Crafter CMS In Context Editing (ICE) attribute retrieval functions for pencils and drop zones (drag and drop)
    • getIceAttributes,
    • getDropZoneAttributes
    • import/use in code by doing
      • import { getIceAttributes } from '@craftercms/ice';
      • import { getDropZoneAttributes } from '@craftercms/ice';
  • Publishing generic util functions
    • repaintPencils: Repaints/repositions Crafter CMS In Context Editing pencils
    • fetchIsAuthoring: Interrogates the current origin server to determine if the site/app is running in Crafter CMS authoring or delivery environments
    • addAuthoringSupport: Includes the necessary scripts to enable Crafter CMS authoring support
    • import { repaintPencils, fetchIsAuthoring, addAuthoringSupport } from '@craftercms/ice'; as needed
  • Publishing React specific bindings via custom hooks:
    • useICE,
    • useDropZone
    • Import/use in code by doing
      • import { useICE } from '@craftercms/ice/esm5/react';
      • import { useDropZone } from '@craftercms/ice/esm5/react';
  • For direct usage in HTML <script/> tags, use the umd build
    <script src="{path-to-your-scripts}/ice/bundles/ice.umd.js"></script>
    <!-- ice/react requires the main ice script -->
    <script src="{path-to-your-scripts}/ice/bundles/react/index.umd.js"></script>
    
  • Notice the multi-platform builds published under
    • bundles (umd)
    • esm5 (module)
    • es2015 (esm2015)
    • fesm5
    • fesm2015

@craftercms/models

  • Removed unpublished createLookupTable function; moved to @craftercms/utils
  • ContentInstance model added

@craftercms/redux

  • redux, redux-observable & rxjs upgraded

@craftercms/search

  • Service refactored as stand alone functions; no need to use as class now though you may still use in the same way as in previous release if you prefer (backward compatible).

@craftercms/utils

  • Publishes createLookupTable util

Global

  • Internal Yarn workspace set up
  • RxJS upgrade for all packages which have it as a dependency
  • Rollup config adjustments
  • Build script updates to print rollup output
  • Added index.js to fesm distributions
  • License updates

Readme

Source

@craftercms/utils

Contains various utilities useful when developing with Crafter CMS

createLookupTable

Creates a lookup table based on an array of items (of a type) and the items id identifier.

Example

  • Create a lookup table of items:
  import { Item, LookupTable } from "@craftercms/models";
  import { createLookupTable } from "@craftercms/utils";

  const items: Item[] = [/* ... */];
  const itemsLookupTable: LookupTable<Item> = createLookupTable<Item>(items, 'url');

The lookupTable will look like this:

  {
    "/site/website/index.xml": {
      "name": "index.xml",
      "url": "/site/website/index.xml",
      "descriptorUrl": "/site/website/index.xml",
      "descriptorDom": { /* ... */ },
      "folder": false
    }
  }

Keywords

FAQs

Last updated on 27 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc