open-index/open-npm huggingface dataset:
npm package: @pie-element/core
Description: Core PIE interfaces and utilities
Latest version: 0.1.0

# @pie-element/core

Core PIE specification types, events, and utilities.

## Installation

```bash
bun add @pie-element/core
```

## Usage

### Types

```typescript
import type { PieModel, PieEnvironment, PieSession, PieController } from '@pie-element/core';
```

### Events

```typescript
import { ModelSetEvent, SessionChangedEvent, ModelUpdatedEvent } from '@pie-element/core';
```

### Utilities

```typescript
import { isEmpty, showFeedback, showRationale, uuid, shuffle } from '@pie-element/core';
```

## Documentation

See [PLAN.md](../../PLAN.md) for full PIE specification details.
npm package: @pie-element/element-theme
Description: Generic web component theme wrapper for PIE element players
Latest version: 0.1.0

# @pie-element/element-theme

Lightweight generic web-component theme wrapper for PIE players.

## Elements

- `pie-element-theme`: generic wrapper that applies `--pie-*` CSS variables.

## Attributes

- `theme`: `light | dark | auto` (default: `light`)
- `scope`: `self | document` (default: `self`)
- `variables`: JSON object of CSS variable overrides (optional)

## Usage

```html
<pie-element-theme theme="light">
  <pie-element-player element-name="multiple-choice"></pie-element-player>
</pie-element-theme>
```

Override one variable:

```html
<pie-element-theme
  theme="light"
  variables='{"--pie-primary":"#0d9488"}'
>
  <pie-element-player element-name="hotspot"></pie-element-player>
</pie-element-theme>
```
npm package: @pie-element/element-theme-daisyui
Description: DaisyUI-powered web component theme wrapper for PIE players
Latest version: 0.1.0

# @pie-element/element-theme-daisyui

DaisyUI-focused theme wrapper package for PIE players.

## Custom element

- `pie-element-theme-daisyui`

## Usage

```html
<pie-element-theme-daisyui theme="dark">
  <pie-element-player element-name="hotspot"></pie-element-player>
</pie-element-theme-daisyui>
```

This package intentionally ships DaisyUI utilities (`extract`, `convert`, `colors`) and does not include React hooks.
npm package: @pie-element/shared-controller-utils
Description: Controller utility functions for PIE elements
Latest version: 0.1.0

# @pie-framework/controller-utils

Controller utility functions for PIE elements.

## Installation

This package is part of the PIE workspace and should be installed via workspace dependencies:

```json
{
  "dependencies": {
    "@pie-framework/controller-utils": "workspace:*"
  }
}
```

## Usage

```typescript
import { /* utility functions */ } from '@pie-framework/controller-utils';
```

## Development

```bash
# Build the package
npm run build

# Watch mode for development
npm run dev

# Run tests
npm run test

# Clean build artifacts
npm run clean
```

## License

MIT
npm package: @pie-element/shared-feedback
Description: Feedback utilities for PIE elements
Latest version: 0.1.0

# @pie-element/shared-feedback

Feedback utilities for PIE elements. Provides utilities for getting feedback messages based on correctness levels.

## Installation

```bash
bun add @pie-element/shared-feedback
```

## Usage

### Basic Usage

```typescript
import { getActualFeedbackForCorrectness } from '@pie-element/shared-feedback';

// Get feedback for a correct answer
const message = getActualFeedbackForCorrectness('correct');
// Returns: 'Correct'

// Get feedback with custom configuration
const customMessage = getActualFeedbackForCorrectness('correct', {
  correct: {
    type: 'custom',
    default: 'Correct',
    custom: 'Excellent work!',
  },
});
// Returns: 'Excellent work!'
```

### Feedback Types

- `default` - Use the default feedback message
- `custom` - Use a custom feedback message
- `none` - Don't show any feedback (returns `undefined`)

### Correctness Levels

- `correct` - The answer is completely correct
- `incorrect` - The answer is completely incorrect
- `partial` - The answer is partially correct
- `unanswered` - No answer was provided

### API

#### `getActualFeedbackForCorrectness(correctness, feedback?)`

Get the feedback message for a specific correctness level (synchronous).

**Parameters:**
- `correctness`: `'correct' | 'incorrect' | 'partial' | 'unanswered' | 'partially-correct'`
- `feedback`: `Partial<Feedback>` (optional) - Custom feedback configuration

**Returns:** `string | undefined`

#### `getFeedbackForCorrectness(correctness, feedback?)`

Async version of `getActualFeedbackForCorrectness`.

**Parameters:**
- `correctness`: `'correct' | 'incorrect' | 'partial' | 'unanswered' | 'partially-correct'`
- `feedback`: `Partial<Feedback>` (optional) - Custom feedback configuration

**Returns:** `Promise<string | undefined>`

## TypeScript

This package is written in TypeScript and includes type definitions.

```typescript
import type { Feedback, FeedbackConfig, Correctness } from '@pie-element/shared-feedback';
```

## Default Feedback Messages

- **Correct**: "Correct"
- **Incorrect**: "Incorrect"
- **Partial**: "Nearly"
- **Unanswered**: "You have not entered a response"

## License

MIT
npm package: @pie-element/shared-test-utils
Description: Testing utilities for PIE elements
Latest version: 0.1.0

# @pie-element/test-utils

Testing utilities for PIE element development.

## Installation

```bash
bun add -D @pie-element/test-utils
```

## Usage

### Controller Testing

```typescript
import { testController, testEnvironments } from '@pie-element/test-utils';
import { myController } from './controller';

const testCases = [
  {
    name: 'returns correct view model in gather mode',
    question: { id: '1', element: '@pie-element/my-element' },
    session: null,
    env: testEnvironments.studentGather,
    expectedViewModel: {
      disabled: false,
      mode: 'gather',
    },
  },
];

const results = await testController(myController, testCases);
console.log(results); // [{ passed: true, testCase: '...', errors: [] }]
```

### Fixtures

```typescript
import { createTestModel, createTestSession, testPrompts } from '@pie-element/test-utils';

const model = createTestModel({ prompt: testPrompts.withMath });
const session = createTestSession({ value: ['answer1'] });
```

### Web Component Testing

```typescript
import {
  mountComponent,
  waitForEvent,
  simulateClick,
  querySelector,
} from '@pie-element/test-utils';

// Mount a component
const element = await mountComponent('my-element', {
  model: myModel,
  session: mySession,
});

// Wait for events
const sessionData = await waitForEvent(element, 'pie.session_changed');

// Simulate interactions
const button = querySelector(element, 'button');
simulateClick(button);
```

## API Reference

See [TypeScript definitions](./src/index.ts) for complete API documentation.