New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@craftercms/ice

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@craftercms/ice - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

react/package.json

5

package.json
{
"name": "@craftercms/ice",
"version": "1.2.2",
"version": "1.2.3",
"description": "Crafter CMS in-context editing library",
"main": "./bundles/ice.umd.js",
"browser": "./bundles/ice.umd.js",
"module": "./esm5/ice.js",

@@ -39,3 +38,3 @@ "es2015": "./esm2015/ice.js",

"dependencies": {
"@craftercms/models": "1.2.2",
"@craftercms/models": "1.2.3",
"tslib": "^1.10.0"

@@ -42,0 +41,0 @@ },

56

README.md

@@ -0,1 +1,3 @@

![npm (scoped)](https://img.shields.io/npm/v/@craftercms/ice?style=plastic)
# @craftercms/ice

@@ -5,4 +7,56 @@

**Note**: All methods of this package work with [Content Instance](../models/src/ContentInstance.ts) as data structure they understand (the model param). Use in conjunction with `parseDescriptor` from `@craftercms/content` to obtain such data structure.
**Note**: All methods of this package work with [Content Instance](../models/src/ContentInstance.ts) as data structure they understand (the model param). Use in conjunction with `parseDescriptor` from `@craftercms/content` to obtain such data structure.
## Usage
## Via npm
- `yarn add @craftercms/ice` or `npm install @craftercms/ice`
- `import` or `require` the functions you wish.
The examples below assume usage via npm.
## Via html script imports
- Download the bundle and import them in your page.
- The bundles declare a global variable named `craftercms`. You can access all craftercms' packages and functions under this root.
- The `ice` package depends on rxjs, make sure to import rxjs too before the `ice` script.
**Tip**: Once you've imported the scripts, type `craftercms` on your browser's dev tools console to inspect the package(s)
### Vanilla html/js example
```html
<div id="myFeature"></div>
<script src="https://unpkg.com/rxjs"></script>
<script src="https://unpkg.com/@craftercms/utils"></script>
<script src="https://unpkg.com/@craftercms/classes"></script>
<script src="https://unpkg.com/@craftercms/content"></script>
<script src="https://unpkg.com/@craftercms/ice"></script>
<script>
(function ({ content, ice }, { operators }) {
content.getItem(
'/site/website/index.xml',
{ baseUrl: 'http://localhost:8080', site: 'editorial' }
).pipe(
operators.map(content.parseDescriptor)
).subscribe((model) => {
const attrs = ice.getICEAttributes({ model, parentModelId: '/site/website/index.xml' });
const elem = document.querySelector('#myFeature');
Object.entries(attrs).forEach(([attr, value]) => {
elem.setAttribute(attr, value);
});
Object.entries(model).forEach(([fieldId, value]) => {
if (fieldId !== 'craftercms') {
const el = document.createElement('div');
el.innerText = `${fieldId}: ${value}`;
elem.appendChild(el);
}
});
});
})(craftercms, rxjs);
</script>
```
## fetchIsAuthoring

@@ -9,0 +63,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc