
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
@forge/ui-confluence
Advanced tools
A package of helpers for interacting with Confluence
Allows interacting with Confluence content properties.
Note permissions apply to interacting with content properties, for the page being accessed. So it is impacted by the user being used to interact with Confluence (is app or request user).
Example usage:
import Forge, { render, Fragment, Text, Button, useAction, useProductContext } from "@forge/ui";
import { contentProperties } from '@atlasian/forge-ui-confluence';
export type AppState = {
count: number;
}
const KEY_PREFIX = 'counter';
const App = () => {
const { contentId, localId } = useProductContext();
const contentProps = contentProperties(contentId, api.asApp().requestConfluence);
const key = `${KEY_PREFIX}-${localId}`;
const initialAppState = async (): Promise<AppState> => {
const countProp = await contentProps.read(key);
const count: number = countProp && (countProp.value as number) || 0;
return {
count,
};
}
const updateCount = async (oldState: AppState, action: string): Promise<AppState> => {
switch (action) {
case 'modify':
await contentProps.modify(key, (prev) => ((prev as number || 0) + 1));
return initialAppState();
case 'replace':
await contentProps.replace(key, oldState.count + 1);
return initialAppState();
case 'delete':
await contentProps.delete(key);
return initialAppState();
case 'refresh':
return initialAppState();
}
return oldState;
}
const [appState, doAction] = useAction<AppState, string>(updateCount, initialAppState);
return (
<Fragment>
<Text>Current value {appState.count}</Text>
<Button text="Add one (modify)" onClick={() => { doAction('modify'); }} />
<Button text="Add one (replace)" onClick={() => { doAction('replace'); }} />
<Button text="Reset data (delete)" onClick={() => { doAction('delete'); }} />
<Button text="Refresh (read)" onClick={() => { doAction('refresh'); }} />
</Fragment>
);
};
export const run = render(<App />);
FAQs
Helpers for interacting with Confluence
The npm package @forge/ui-confluence receives a total of 238 weekly downloads. As such, @forge/ui-confluence popularity was classified as not popular.
We found that @forge/ui-confluence demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.